
                    DOCUMENTATION FOR LOCATE3 PROGRAM


INTRODUCTION

This is a Locator program for HF and VHF/UHF enthusiasts alike. It is a
very large program, and consists of two separate parts, but you can
'toggle' between them at any time. The first part enables you to find the
distance between any two points on the Earth's surface, plus the radial
ring score, and the outgoing and return bearings. In addition, it
'translates' between the various common co-ordinates. The systems
supported are Latitude and Longitude, UK Ordnance Survey Map Reference,
(National Grid reference), Worked-All-Britain code, European 5-figure QTH
locator code, and the new 6-figure GM4ANB Maidenhead Universal Locator
Code, (MUL), which was adopted in January 1985. You may nominate an entry
as the new 'home' station at any time. This is attractively  presented on
the screen display, with individual 'windows' for the home and dx
stations, plus easy-to-use menu of commands. The other part is a VHF/UHF
contest-scoring program. You may enter either 5 or 6-figure locators in
any mixture. The display gives the distance in kilometres, the radial-ring
score, and the outgoing bearing. You may switch a printer in or out any
time for hard copy of contacts, (the Electron requires PLUS-1 or similar
interface to use this facility). The program gives automatic page totals
after each 25 entries for standard RSGB logsheets, but this can be altered
as required. You can allow for non-scoring contacts, and correct the
previous entry if you made a mistake. If necessary, you can restart where
you left off after a previous session. When the entries are complete, you
can obtain all the totals, plus useful statistics on best dx worked,
average points and distance per contact. Naturally, full validation is
included to reject 'impossible' locators. You may 'toggle' to the first
part at any time, in order to check details of a station not giving his
locator, and then continue where you left off.


THE FIRST SECTION

When you run the program, you will enter the first section. This functions
independently, but may be accessed from the main contest-scoring part of
the program if required. The top of the screen is split into two
"windows"; the upper one gives information about the "home" or "base"
station, and is labelled "ME". The lower one gives information about the
other station, and is labelled "DX". Below the DX window is a line which
displays the distance between the two stations, the 50km radial ring
score, and also the outgoing and reverse bearings. There is a simple menu
to enable you to choose which co-ordinates you wish to enter. The <Escape>
key may be used to return to the menu, and if it is pressed again instead
of selecting from the menu, then you will move into the other section of
the program.

You may enter Longitude and Latitude, or National Grid reference, or
either of two locator codes. The first is the familiar five-digit "QRA" or
"QTH" locator code, such as ZM43e for the city of Coventry. The second is
the new six-digit Maidenhead Universal Locator system proposed by  GM4ANB,
such as IO92fj for Coventry. Details of the GM4ANB system can be found in
Radio Communication magazine, November 1980 and October 1984, and in the
current International VHF FM Guide. It does not matter if you type in
upper or lower-case, or any combination, as the screen will always show
the conventional form. The OS MAP reference must be entered in full, to an
accuracy of 100 metres. For example Coventry city centre would be
SP:335:785 . You can also enter the WAB code, by 'padding' it with 50, as
it is simply an abbreviation of the Map Reference. Eg., for SE31 enter
SE:350:150, but remember this is only accurate to within 7 kms. If the Map
Reference is rejected, then this means that the position is outside the
range of the grid system. Note that the Channel Islands, Scilly Isles, and
much of the Irish Republic are not covered either. It is generally more
convenient to look up a grid reference than lines of longitude and
latitude, as the latter are slightly curved, and at an angle on OS maps.
To complete the WAB code, you should specify the local District Council,
but this is beyond the scope of this program!

When you enter a location, it will appear in the lower window, together
with the equivalent in all the other co-ordinates. The co-ordinates you
actually entered will show up to distinguish them from the "translations".
On the BBC they are shown in yellow instead of cyan, and on the Electron
they are marked by a little Acorn symbol. The first entry made will also
be transferred into the upper window, and will be taken as the home
station until you nominate a new one. When you enter further locations,
they will only go into the lower window, and the line below will indicate
the great-circle distance and bearings. Note that the outgoing and reverse
bearings will only be 180 degrees apart over relatively small distances,
away from the poles. If one station is close to one of the poles, then the
bearings can appear very strange indeed, but this is quite natural.

The OS National Grid does not exist beyond the land area of the UK, and
the 5-digit locator system does not exist beyond Europe, so these displays
will show the message "Limits" if the position is outside the appropriate
area. Only score points below 200 are displayed, as higher figures are
outside VHF DX distances. You may nominate a new base station at any time,
by selecting option 4 on the menu. This will move the location in the
lower window up to the upper one. To change to entering a different type
of co-ordinate, press <Escape> to give you access to the menu. If you
press <Escape> again, you will move to the other section of the program.
You will lose all information on the screen when you do this, but this is
not the case when returning, as you will discover.


THE SECOND SECTION

When you Escape from the first section, you will enter the second, and
will be asked if this is the first session on that particular contest. You
may Escape out of the program altogether at this stage, if you wish. If
you answer "N", then you will be prompted to give details of the last
contact dealt with on the previous session, and of the various totals
obtained. If you answer "Y", you will then be prompted for your own "base"
locator code. Note that this is quite independent of any entries which you
made in the first section. You may enter either 5 or 6-digit locators as
you prefer. Having done that, you are prompted to enter the locators of
each station worked against the serial number. You may enter either 5 or
6-digit locators, in any combination. In addition, there are several
commands available, and these are summarized at the top of the screen.
"ON" will activate the printer if you want hard copy of each contact, and
"OFF" will cancel it. These two commands are acknowledged with a pinging
or bleeping noise, and the printer flag at the top right of the screen
will show the current status. If you enter an invalid locator, such as
ZN23i, or ZS92kl, then a nasty noise will warn you, and you will be
re-prompted. In order to keep the serial numbers in sequence, you may
enter "NS" for Non-Scoring contacts, and these are scored as zero. If you
accidentally type an incorrect but valid locator, you may enter "ERR" to
erase it. You may only go back one contact, but you can correct the same
entry as many times as you like. If you type "ERR" after you have been
given a page total, then you will be given a revised page total when the
entry is corrected. Finally, you can type "END", which will give you the
last page total, plus the grand totals, best DX worked etc.. This is the
only way out of the program, short of pressing <Break>! If you haven't
actually finished entering all the contacts, then you should make a note
of all the totals, best DX worked, and the last serial number, so that you
can continue where you left off on some future occasion. As with the
locator codes, you may type in upper or lower-case as you prefer.

It may happen that you are suspicious of a location, or were only given a
position relative to a town. In that case, you may use the first section
by pressing <Escape> ONCE. After a short pause, you will see the first
section page appear, and you can then make any checks you wish. The two
sections are quite independent, but for convenience the base locator you
have been using in the second section will be transferred to the first.
The prompt will be for you to enter a further locator, but if you wish to
enter other coordinates instead, you can simply <Escape> to the menu and
select another option. If you wish, you may use option 4 to nominate a new
base locator, and this will have no effect on the original base locator
used in the second section. When you have finished, <Escape> to the menu,
and then press <Escape> again once. You will then be returned to the point
where you left off, and the screen display will be fully restored.

The only 'legal' exit route from the program at this stage is to type END
instead of a locator code, as Escape only toggles between the 2 sections.


TOTALS

The standard RSGB contest logsheets have room for 25 entries per page, (27
on older ones). If you are using sheets which do not have 25 per page,
then you can alter the variable "pagelength%" or "paglen%", which you will
find in a procedure called "DEFPROCinitialise" or "DEFPROCinit" at line
6350. After every 25 contacts, including non-scorers, you will be given a
page total. When you type "END", you will automatically get the last page
total as well as the grand totals. When restarting, ie. you answered "N"
to the question "is this the first work period...?", then you must enter
the last serial number, various totals, and the best DX from the previous
session. If you finished partway down a page, the program will deduce this
from the serial number, and ask you for the last partial page total.


USING A PRINTER

If your printer performs an auto linefeed after a Carriage-Return, then
you should alter the *FX6,0 in line 160 to FX6,10 in order to prevent
double line-spacing. The printout format is suitable for all printers with
at least 40 columns. If you activate the printer with "ON", but forget to
switch the printer on line, then the program will "hang-up" with a full
print buffer. In most cases, if this happens for more than 5 seconds, then
the program will automatically enter "OFF", and return to normal
operation. Do not panic and start pressing the <Escape> key; it won't do a
bit of good! You could then enter "ERR", switch the printer on properly
this time, enter "ON", and then carry on where you left off. The 5 second
time delay can be found in a procedure called "DEFPROCflush" at line 6930,
so you can alter the "TIME>500" if desired.


ACCURACY

It is important to realise exactly what is being calculated and why. In
every case, the distance and bearings are calculated from the Longitude
and Latitude, regardless of what type of co-ordinates were entered. If you
enter National Grid co-ordinates, then these are converted to Longitude
and Latitude before any calculations are made. If you enter a locator
code, then the longitude and latitude of the square centre is calculated,
and used in all future  computations. The fact that the two locator system
grid squares do not exactly coincide in longitude can produce some
apparently odd results. For example, if you enter QTH locator ZL45h, then
this is "translated" as being IO91kl in the MUL system. However, if you
enter IO91kl, then this is translated back as ZL45a. This is not due to
any inaccuracy in the program. What has happened is that the centre of
ZL45h square lies within the bounds of IO91kl square. However, the centre
of IO91kl square lies within the bounds of ZL45a square. In other words,
there is an uncertainty of one small square to the East or West. Note also
that the old 5-digit QTH Locator system repeats at intervals, and this can
be confusing. 

The conversion between locator codes and the Longitude and Latitude of the
square centres uses integer arithmetic, and is precise. The reverse
conversion is also precise; any borderline cases are counted as being in
the square immediately to the right and/or North of the boundary. The
conversion to and from National Grid reference may involve a slight error,
due to the resolution of 100 metres, and to the complexity of the
equations involved. In practice this error is less than 0.2 km, but where
an unusually precise location is important, such as in a borderline case,
use Longitude and Latitude.

In calculating the distance and bearing, the Earth is assumed to be a
uniform sphere of radius 6371 km, which is a true mean value, based on
surface area. The Earth is actually slightly flattened at the poles, but
the maximum possible error is less than 20 km over large distances, and
will generally be very much less. Over normal VHF DX distances in Europe,
the error will be very small; perhaps no more than 2 km. The maximum
great-circle distance between any two points on the Earth's surface is
about 20,015 km; ie. the mean circumference is about 40,030 km. The great
circle bearings will generally be accurate within 1 degree. However, you
must remember that if you enter a Locator code, then the calculations will
be based on the locator square centre, and not on the actual position of
the station within that square.


LOCATOR ORIGIN

The main drawback of the old 5-digit locator code is that it is unsuitable
for Worldwide use, as it repeats at intervals of 52 degrees in longitude,
and 26 degrees in latitude. This program has a bottom left-hand "Origin"
of 12 degrees West and 35 degrees North, which means that the normal range
is from UU01h square in the North West down to TV80d square in the South
East. If required, the origin may be moved slightly by altering
"originlat%" in steps of 1 degree, and "originlong%" or "originlng%" in
steps of 2 degrees. These variables may be found in a procedure called
"DEFPROCconstants" or "DEFPROCconst" at line 1130.


COPYRIGHT NOTICE

This program is now in the Public Domain. Please feel free to distribute
UNMODIFIED copies to other parties, provided it is not in return for
payment, and ONLY if accompanied by this documentation file.
                                                                          
                                                     (C) BLT Software 1984
'Rick' Sterry G4BLT @ GB7WRG
1 Wavell Garth
Sandal Magna
WAKEFIELD
West Yorkshire
WF2 6P                                  
