I have been doing this since 1991 using a hand-held global positioning receiver. It is important to know the latitude as the sun arc across the sky will change depending upon latitude, as will rise/set times of both the sun and moon.
I use a Trimble Scout. Once it is programmed with the correct time offset from Greenwich Mean Time (GMT) for the time zone you are working in, it will do the rest as it knows the time from the satellites, and (obviously) can calculate latitude and longitude. It will then tell azimuth, altitude, and compass direction of the sun or moon in 5 minute increments. You can also use it to predict future positions, because it will let you enter a future time and date in the sunrise/sunset, moonrise/moonset function.
This device along with a Brunton Pocket Transit (compass with built in levels to "shoot" elevations) have proven invaluable in many photo situations. You might want to check out the Magellan Platinum. I know it will do sunrise/sunset and moonrise/moonset functions, but I don't know if it will allow entry of future times and dates. It does have a built-in compass function along with its GPS location function. Unlike many hand-held receivers, it does not have to be moving to tell compass direction.