summaryrefslogtreecommitdiff
path: root/map65/libm65/deg2grid.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
committerChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
commitf647d78463c1250ce9c99af664615fafccf5e959 (patch)
tree5b00428cef68aef1c9d407e2d4535687422419b6 /map65/libm65/deg2grid.f90
parent0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff)
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'map65/libm65/deg2grid.f90')
-rw-r--r--[-rwxr-xr-x]map65/libm65/deg2grid.f9060
1 files changed, 30 insertions, 30 deletions
diff --git a/map65/libm65/deg2grid.f90 b/map65/libm65/deg2grid.f90
index fdbb5f2f..9ca3602f 100755..100644
--- a/map65/libm65/deg2grid.f90
+++ b/map65/libm65/deg2grid.f90
@@ -1,30 +1,30 @@
-subroutine deg2grid(dlong0,dlat,grid)
-
- real dlong !West longitude (deg)
- real dlat !Latitude (deg)
- character grid*6
-
- dlong=dlong0
- if(dlong.lt.-180.0) dlong=dlong+360.0
- if(dlong.gt.180.0) dlong=dlong-360.0
-
-! Convert to units of 5 min of longitude, working east from 180 deg.
- nlong=60.0*(180.0-dlong)/5.0
- n1=nlong/240 !20-degree field
- n2=(nlong-240*n1)/24 !2 degree square
- n3=nlong-240*n1-24*n2 !5 minute subsquare
- grid(1:1)=char(ichar('A')+n1)
- grid(3:3)=char(ichar('0')+n2)
- grid(5:5)=char(ichar('a')+n3)
-
-! Convert to units of 2.5 min of latitude, working north from -90 deg.
- nlat=60.0*(dlat+90)/2.5
- n1=nlat/240 !10-degree field
- n2=(nlat-240*n1)/24 !1 degree square
- n3=nlat-240*n1-24*n2 !2.5 minuts subsquare
- grid(2:2)=char(ichar('A')+n1)
- grid(4:4)=char(ichar('0')+n2)
- grid(6:6)=char(ichar('a')+n3)
-
- return
-end subroutine deg2grid
+subroutine deg2grid(dlong0,dlat,grid)
+
+ real dlong !West longitude (deg)
+ real dlat !Latitude (deg)
+ character grid*6
+
+ dlong=dlong0
+ if(dlong.lt.-180.0) dlong=dlong+360.0
+ if(dlong.gt.180.0) dlong=dlong-360.0
+
+! Convert to units of 5 min of longitude, working east from 180 deg.
+ nlong=60.0*(180.0-dlong)/5.0
+ n1=nlong/240 !20-degree field
+ n2=(nlong-240*n1)/24 !2 degree square
+ n3=nlong-240*n1-24*n2 !5 minute subsquare
+ grid(1:1)=char(ichar('A')+n1)
+ grid(3:3)=char(ichar('0')+n2)
+ grid(5:5)=char(ichar('a')+n3)
+
+! Convert to units of 2.5 min of latitude, working north from -90 deg.
+ nlat=60.0*(dlat+90)/2.5
+ n1=nlat/240 !10-degree field
+ n2=(nlat-240*n1)/24 !1 degree square
+ n3=nlat-240*n1-24*n2 !2.5 minuts subsquare
+ grid(2:2)=char(ichar('A')+n1)
+ grid(4:4)=char(ichar('0')+n2)
+ grid(6:6)=char(ichar('a')+n3)
+
+ return
+end subroutine deg2grid