diff -u ORG/dpam/ggrids.f90 dpam/ggrids.f90
--- ORG/dpam/ggrids.f90	2017-12-23 18:00:00.000000000 +0900
+++ dpam/ggrids.f90	2018-02-13 15:44:22.000000000 +0900
@@ -386,6 +386,7 @@
     write(99,'(a,a)') '  trim radius :', strim
     write(99,'(a,a)')   &
       ' Surface grid output filename : ', fnam2(1:lrtrim(fnam2))
+    write(99,'(8x,a,a)') 'Mag. anomaly, and Surface elevation ', can
     write(99,'(a12,a8,6x,a6,i4,4x,4i8)')   &
       'Areaname :  ', area, 'Coord.', ncc, iorg, korg, ispa, ispb
     write(99,'(4x,a)')   &
diff -u ORG/dpam/xldam.f90 dpam/xldam.f90
--- ORG/dpam/xldam.f90	2017-12-23 18:00:00.000000000 +0900
+++ dpam/xldam.f90	2018-07-07 15:40:44.000000000 +0900
@@ -8,7 +8,7 @@
 !*************************************************************
   implicit none
   real,parameter :: xdeg = 111111.1         ! length (m) of 1 deg. meridian
-  real(8),parameter :: pai = (3.14159265359/180.)
+  real,parameter :: pai = (3.14159/180.)
   integer :: lwkdir, lrtrim
   real :: fid(300), fx(300), fy(300), fz(300)
   real(8) :: tmag(300), wtm(300), secs(300)
@@ -127,7 +127,7 @@
         write(str(1:8),'(f8.1)') fid(1)
         call premsg('--- GPS data lost after Fid.=' // str(1:8))
       endif
-      sec = secs(nps) - secn
+      sec = sngl(secs(nps) - secn)
       write(6,'(a,f8.2,a,f7.1)')   &
         '  AM time-offset: ', sec, ' sec at Fid.=', fid(nps)
       write(9,'(a,f8.2,a,f7.1)')   &
@@ -142,17 +142,18 @@
     do while ((it <= 80) .and. (str(it:it) /= ' '));  it = it + 1;  enddo
     if (it > 80) call abendm('Lines.Inf. data illegal')
     name = str(is:it-1)
+!***
     if (kc == 0) then
       read(str(it:80),*) tms, tme
+      xnc = 0.;  yec = 0.;  zuc = 0.
     else
-!***
       read(str(it:80),*) tms, tme, dir
       dir = dir * pai
       xnc = forwd*cos(dir) - strbd*sin(dir)
       yec = forwd*sin(dir) + strbd*cos(dir)
       zuc = -dwnwd
-!***
     endif
+!***
     write(str,'(a8,1x,i9,1x,f9.2,1x,f9.2)') name, iymd, tms, tme
     call premsg('   Line: ' // str(1:38))
     write(20,'(a1,a)') '&', str(1:38)
@@ -175,7 +176,7 @@
         if (secs(mps) < secst) cycle
         kintv = kintv - 1
         if (kintv == 0) then
-          f = (secs(mps)-sec1) / (secn-sec1)
+          f = sngl(secs(mps)-sec1) / sngl(secn-sec1)
           dido = dido1 + (didon-dido1)*f
           dkdo = dkdo1 + (dkdon-dkdo1)*f
           falt = falt1 + (faltn-falt1)*f
@@ -189,7 +190,7 @@
           if ((dido < -80.) .or. (dido > 80.))  &
             call abendm('Polar region not supported')
           if (abs(dido-didop) > 0.175) then
-            didop = dido;  ydeg = xdeg * cos(dido * pai)
+            didop = dido;  ydeg = xdeg * cos(sngl(dido) * pai)
           endif
           dido = dido + xnc/xdeg;  dkdo = dkdo + yec/ydeg;  falt = falt + zuc
 !***
@@ -280,6 +281,7 @@
     write(99,'(a,f7.2)') '   Year of survey  : ', year
     write(99,'(a,i2)')   '   IGRF generation : ', ngn
     write(99,'(a,i3)')   '  Data thin-out ratio :', intv
+!***
     if (kc == 0) then
       write(99,'(a)')   '  Not corrected for Mag.Sensor offset from GPS'
     else
@@ -287,6 +289,7 @@
       write(99,'(3(6x,a,f6.2))')  &
         'Forward:', forwd, 'Starboard:', strbd, 'Downward:', dwnwd
     endif
+!***
     do
       read(9,'(a)',iostat=IER) line
       if (IER < 0) exit
diff -u ORG/dpam/xldpn.f90 dpam/xldpn.f90
--- ORG/dpam/xldpn.f90	2017-12-23 18:00:00.000000000 +0900
+++ dpam/xldpn.f90	2018-07-07 15:40:44.000000000 +0900
@@ -8,7 +8,7 @@
 !*************************************************************
   implicit none
   real,parameter :: xdeg = 111111.1         ! length (m) of 1 deg. meridian
-  real(8),parameter :: pai = (3.14159265359/180.)
+  real,parameter :: pai = (3.14159/180.)
   integer :: lwkdir, lrtrim
   character(80) :: wdr, flog, finf, fnam, fpos, fout
   character(160) :: line;  character(80) :: str;  character(60) :: ss
@@ -19,7 +19,7 @@
   real :: fid, fx, fy, fz, year, sec
   real :: falt, falta, faltb, f, tigrf, tres
   real(8) :: wtm, tms, tme, tmsr, tmer
-  real :: sect, seca, secb, secst, seced
+  real(8) :: sect, seca, secb, secst, seced
   real(8) :: tmag, dido, didoa, didob, dkdo, dkdoa, dkdob, didop
 
   call premsg('XLDPN : Extract Line data  from daq2asc output')
@@ -56,6 +56,7 @@
   call gparmi(' Generation number of IGRF : ', ngn)
   call gparmi(' Thin-out Ratio N (crop 1 out of N) ==> ', intv)
   if (intv <= 0) intv = 1
+!***
   call premsg(' Correction for Mag.Sensor offset from GPS antenna')
   call premsg('  (To disable correction, Enter blank line or "0  0  0")')
   call parmin('    [Forward, Starboard, Downward] (in m)  ==> ', 80, str)
@@ -70,6 +71,7 @@
       (dwnwd > 50.) .or. (dwnwd < -50.))  &
     call abendm('Abnormal offset data')
   if ((forwd == 0.) .and. (strbd == 0.) .and. (dwnwd == 0.)) kc = 0;
+!***
   call clspin()
   write(6,'(a)') '----------------------------------------'
   write(6,'(a)') 'XLDPN : Extract Line data  from daq2asc output'
@@ -86,9 +88,11 @@
   write(6,'(a,f7.2)') '   Year of survey  : ', year
   write(6,'(a,i2)')   '   IGRF generation : ', ngn
   write(6,'(a,i3)')   '  Data thin-out ratio :', intv
+!***
   write(6,'(a)')   ' Mag.Sensor offset from GPS antenna (m)'
   write(6,'(3(6x,a,f6.2))')  &
     'Forward:', forwd, 'Starboard:', strbd, 'Downward:', dwnwd
+!***
   call gigrf(ngn, year)
   open(9,status='scratch')
   kam = 0; kpn = 0
@@ -167,8 +171,10 @@
     do while ((it <= 80) .and. (str(it:it) /= ' '));  it = it + 1;  enddo
     if (it > 80) call abendm('Lines.Inf. data illegal')
     name = str(is:it-1)
+!***
     if (kc == 0) then
       read(str(it:80),*) tms, tme
+      xnc = 0.;  yec = 0.;  zuc = 0.
     else
       read(str(it:80),*) tms, tme, dir
       dir = dir * pai
@@ -176,6 +182,7 @@
       yec = forwd*sin(dir) + strbd*cos(dir)
       zuc = -dwnwd
     endif
+!***
     read(str(it:80),*) tms, tme
     write(str,'(a8,1x,i9,1x,f9.2,1x,f9.2)') name, iymd, tms, tme
     call premsg('   Line: ' // str(1:38))
@@ -228,7 +235,7 @@
       enddo
       kintv = kintv - 1
       if (kintv == 0) then
-        f = (sect-seca) / (secb-seca)
+        f = sngl(sect-seca) / sngl(secb-seca)
         dido = didoa + (didob-didoa)*f
         dkdo = dkdoa + (dkdob-dkdoa)*f
         falt = falta + (faltb-falta)*f
@@ -242,7 +249,7 @@
         if ((dido < -80.) .or. (dido > 80.))  &
           call abendm('Polar region not supported')
         if (abs(dido-didop) > 0.175) then
-          didop = dido;  ydeg = xdeg * cos(dido * pai)
+          didop = dido;  ydeg = xdeg * cos(sngl(dido) * pai)
         endif
         dido = dido + xnc/xdeg;  dkdo = dkdo + yec/ydeg;  falt = falt + zuc
 !***
@@ -287,6 +294,7 @@
     write(99,'(a,f7.2)') '   Year of survey  : ', year
     write(99,'(a,i2)')   '   IGRF generation : ', ngn
     write(99,'(a,i3)')   '  Data thin-out ratio :', intv
+!***
     if (kc == 0) then
       write(99,'(a)')   '  Not corrected for Mag.Sensor offset from GPS'
     else
@@ -294,6 +302,7 @@
       write(99,'(3(6x,a,f6.2))')  &
         'Forward:', forwd, 'Starboard:', strbd, 'Downward:', dwnwd
     endif
+!***
     do
       read(9,'(a)',iostat=IER) line
       if (IER < 0) exit
