aboutsummaryrefslogtreecommitdiff
path: root/Getnum.f
diff options
context:
space:
mode:
Diffstat (limited to 'Getnum.f')
-rwxr-xr-xGetnum.f24
1 files changed, 24 insertions, 0 deletions
diff --git a/Getnum.f b/Getnum.f
new file mode 100755
index 0000000..6b19e43
--- /dev/null
+++ b/Getnum.f
@@ -0,0 +1,24 @@
+
+ subroutine getnum (nchars,line,xnum,xnumsngl)
+c******************************************************************************
+c this routine gets a double precision number 'xnum' and its
+c equivalent single precision number 'xnumsngl' from screen input;
+c if a non-number is typed in, the user will be queried again
+c******************************************************************************
+
+ implicit real*8 (a-h,o-z)
+ real*8 xnum
+ real*4 xnumsngl
+ integer line
+
+
+ xnum = -9999.
+1 call getasci (nchars,line)
+ if (nchars .lt. 0) return
+ call number (nchars,line,xnum)
+ if (xnum .eq. -9999.) go to 1
+ xnumsngl = sngl(xnum)
+ return
+
+ end
+