A numerical algorithm based on Fermat's Principle was developed to simulate the propagation of Global Positioning System (GPS) radio signals in the refractivity field of a numerical weather model. The unique in the proposed algorithm is that the ray-trajectory automatically involves the location of the ground-based receiver and the satellite, i.e. the posed two-point boundary value problem is solved by an implicit finite difference scheme. This feature of the algorithm allows the fast and accurate computation of the signal travel-time delay, referred to as Slant Total Delay (STD), between a satellite and a ground-based receiver. We provide a technical description of the algorithm and estimate the uncertainty of STDs due to simplifying assumptions in the algorithm and due to the uncertainty of the refractivity field. In a first application, we compare STDs retrieved from GPS phase-observations at the German Research Centre for Geosciences Potsdam (GFZ STDs) with STDs derived from the European Center for Medium-Range Weather Forecasts analyses (ECMWF STDs). The statistical comparison for one month (August 2007) for a large and continuously operating network of ground-based receivers in Germany indicates good agreement between GFZ STDs and ECMWF STDs; the standard deviation is 0.5% and the mean deviation is 0.1%.