f2cl0.l 7.21 KB
Newer Older
rtoy's avatar
rtoy committed
1
;; f2cl0.l
rtoy's avatar
rtoy committed
2 3 4 5 6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Copyright (c) University of Waikato;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Hamilton, New Zealand 1992-95 - all rights reserved;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

7
(in-package :common-lisp-user)
rtoy's avatar
rtoy committed
8

rtoy's avatar
rtoy committed
9 10
(defpackage :f2cl-lib
  (:use :cl)
rtoy's avatar
rtoy committed
11
  (:documentation "The package holding all symbols used by the Fortran to Lisp library")
rtoy's avatar
rtoy committed
12
  (:nicknames :fortran-to-lisp-library)
13
  (:export
rtoy's avatar
rtoy committed
14
   ;; Constants
rtoy's avatar
rtoy committed
15
   #:%false% #:%true%
rtoy's avatar
rtoy committed
16
   ;; User-settable runtime options
rtoy's avatar
rtoy committed
17
   #:*check-array-bounds*
rtoy's avatar
rtoy committed
18
   #:*stop-signals-error-p*
rtoy's avatar
rtoy committed
19
   ;; Types
rtoy's avatar
rtoy committed
20 21 22
   #:integer4 #:integer2 #:integer1 #:real8 #:real4 #:complex8 #:complex16
   #:array-double-float #:array-single-float #:array-integer4 #:array-strings
   #:logical
rtoy's avatar
rtoy committed
23 24 25
   ;; Macros
   #:fref #:fset #:with-array-data
   #:with-multi-array-data
rtoy's avatar
rtoy committed
26 27 28 29 30 31 32
   #:f2cl-init-string #:fref-string #:fset-string #:f2cl-set-string
   #:f2cl-// #:fstring-/= #:fstring-= #:fstring-> #:fstring->= #:fstring-< #:fstring-<=
   #:fortran_comment #:fdo #:f2cl/ #:arithmetic-if #:computed-goto
   #:assigned-goto
   #:fformat
   #:data-implied-do
   #:int-add #:int-sub #:int-mul
rtoy's avatar
rtoy committed
33
   ;; Utilities
rtoy's avatar
rtoy committed
34
   #:array-slice #:array-initialize
35 36
   #:f2cl-copy-seq
   #:make-compatible-seq
rtoy's avatar
rtoy committed
37
   ;; Intrinsic functions
rtoy's avatar
rtoy committed
38
   #:abs #:acos #:aimag #:dimag #:aint #:alog #:alog10 #:amax0 #:amax1
rtoy's avatar
rtoy committed
39
   #:amin1 #:amod #:anint #:asin #:atan #:atan2
rtoy's avatar
rtoy committed
40 41
   #:cabs #:cexp #:fchar #:clog #:cmplx #:dcmplx #:conjg #:ccos
   #:csin #:csqrt #:zsqrt #:dabs #:dacos #:dasin
rtoy's avatar
rtoy committed
42
   #:datan #:datan2 #:dble #:dcos #:dcosh #:dexp #:dfloat #:dim
rtoy's avatar
rtoy committed
43 44 45 46 47 48 49
   #:dint #:dlog #:dlog10 #:dmax1 #:dmin1 #:dmod
   #:dnint #:dprod #:dsign #:dsin #:dsinh #:dsqrt #:dtan
   #:dtanh #:ffloat #:iabs #:ichar #:idim #:idint
   #:idnint #:ifix #:index #:int #:isign #:le #:len
   #:lge #:lgt #:flog #:log10 #:lt #:max #:max0
   #:max1 #:min0 #:min1 #:nint #:freal
   #:sign #:sngl #:fsqrt
rtoy's avatar
rtoy committed
50
   #:cdabs #:dconjg
51
   #:len_trim
rtoy's avatar
rtoy committed
52 53
   ;; other functions
   #:d1mach #:r1mach #:i1mach
54
   ))
rtoy's avatar
rtoy committed
55

rtoy's avatar
rtoy committed
56
(defpackage :fortran-to-lisp
rtoy's avatar
rtoy committed
57 58
  (:use :cl)
  (:documentation "The package holding all symbols need by the Fortran to Lisp converter")
rtoy's avatar
rtoy committed
59
  (:nicknames :f2cl)
60
  (:export
rtoy's avatar
rtoy committed
61
   ;; Main routines
rtoy's avatar
rtoy committed
62 63
   #:f2cl
   #:f2cl-compile
64
   #:f2cl-version
65 66
   ))

67 68 69
;;;-------------------------------------------------------------------------
;;; end of f2cl0.l
;;;
70
;;; $Id: f2cl0.l,v 1409c1352feb 2013/03/24 20:44:50 toy $
71
;;; $Log$
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
;;; Revision 1.25  2010/02/23 00:59:12  rtoy
;;; Support the Fortran capability of passing an array of one type
;;; to a routine expecting a different type.  Currently only supports REAL
;;; and COMPLEX arrays (and their double precison versions).
;;;
;;; NOTES:
;;; o Update
;;;
;;; f2cl0.l:
;;; o Export new symbols f2cl-copy-seq and make-compatible-seq.
;;;
;;; f2cl1.l:
;;; o New variable *copy-array-parameter* for keeping track of the option
;;;   for f2cl and f2cl-compile.
;;; o Update f2cl and f2cl-compile to recognize :copy-array-parameter.
;;; o Modify massage-arglist and generate-call-to-routine to handle the
;;;   new :copy-array-parameter capability.
;;;
;;; f2cl5.l:
;;; o Fix issue where quoted elements were modified.  They shouldn't be.
;;; o Fix issue where (array simple-float (*)) would get erroneously
;;;   converted to (array simple-float (f2cl-lib:int-mul)).  We want to
;;;   leave bare * alone.
;;;
;;; macros.l:
;;; o New macro f2cl-copy-seq to generate code to copy a sequence
;;;   appropriately.
;;; o New function to create a compatible array to support
;;;   :copy-array-parameter.
;;;
rtoy's avatar
rtoy committed
102 103 104
;;; Revision 1.24  2009/01/08 15:54:01  rtoy
;;; Remove junk comments.
;;;
rtoy's avatar
rtoy committed
105 106 107 108 109 110 111 112 113
;;; Revision 1.23  2009/01/08 12:57:19  rtoy
;;; f2cl0.l:
;;; o Export *STOP-SIGNALS-ERROR-P*
;;;
;;; macros.l:
;;; o Add *STOP-SIGNALS-ERROR-P* to allow user to control whether STOP
;;;   signals a continuable error or not.  Default is to signal the
;;;   error.
;;;
rtoy's avatar
rtoy committed
114 115 116 117 118 119 120 121 122 123 124 125
;;; Revision 1.22  2009/01/07 17:28:19  rtoy
;;; f2cl0.l:
;;; o Export new dfloat function, an alias for dble.
;;; o Merge some cleanups from Maxima.
;;;
;;; f2cl1.l:
;;; o Add dfloat to list of intrinsic functions.
;;;
;;; macros.l:
;;; o Merge some cleanups and fixes from Maxima.  Mostly for gcl and ecl.
;;; o Add implementation of dfloat.
;;;
126 127 128 129 130 131
;;; Revision 1.21  2008/02/22 22:13:18  rtoy
;;; o Add function F2CL-VERSION to get version info.
;;; o Add version string to each of the files so F2CL-VERSION can get the
;;;   version info.  The version string is basically the date of when the
;;;   file was last checked in.
;;;
rtoy's avatar
rtoy committed
132 133 134 135 136 137 138 139 140
;;; Revision 1.20  2006/12/01 04:23:43  rtoy
;;; Minor cleanups
;;;
;;; src/f2cl0.l:
;;; o Cosmetic changes
;;;
;;; src/macros.l:
;;; o Make code work with "modern"-mode lisps.  (Ported from maxima.)
;;;
rtoy's avatar
rtoy committed
141 142 143
;;; Revision 1.19  2006/11/27 15:15:19  rtoy
;;; Fix typo.
;;;
rtoy's avatar
rtoy committed
144 145 146
;;; Revision 1.18  2006/11/21 22:04:07  rtoy
;;; Export dcabs and dconjg.
;;;
rtoy's avatar
rtoy committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
;;; Revision 1.17  2006/04/27 17:43:58  rtoy
;;; src/f2cl0.l:
;;; o Export dimag, dcmplx, zsqrt
;;;
;;; src/f2cl1.l:
;;; o Add dcmplx, dimag, and zsqrt to the list of intrinsic function
;;;   names.
;;; o When parsing "implicit none" statements, we don't modify
;;;   *IMPLICIT_VBLE_DECLS*. I don't think it's needed and it can cause
;;;   errors later on because :none is not a Lisp type.
;;;
;;; src/f2cl5.l:
;;; o Tell GET-FUN-ARG-TYPE about the result type of dcmplx, dsqrt, the
;;;   complex*8 and complex*16 special functions.
;;; o ABS is an allowed lisp name.  This gets rid of the spurious ABS$
;;;   local variable whenever we use the ABS function.
;;;
;;; src/macros.l:
;;; o Add implementations of dcmplx, dimag, and zsqrt.  (We need to add
;;;   more, I think.)
;;;
rtoy's avatar
rtoy committed
168 169 170
;;; Revision 1.16  2003/11/13 05:37:31  rtoy
;;; Export WITH-MULTI-ARRAY-DATA.
;;;
rtoy's avatar
rtoy committed
171 172 173 174 175 176 177
;;; Revision 1.15  2002/09/13 17:50:18  rtoy
;;; From Douglas Crosher:
;;;
;;; o Make this work with lower-case Lisps
;;; o Fix a few typos
;;; o Make a safer fortran reader.
;;;
rtoy's avatar
rtoy committed
178 179 180
;;; Revision 1.14  2002/04/18 13:03:29  rtoy
;;; Forgot to export I1MACH.
;;;
rtoy's avatar
rtoy committed
181 182 183
;;; Revision 1.13  2002/03/11 16:40:21  rtoy
;;; Export INT-ADD, INT-SUB, INT-MUL.
;;;
rtoy's avatar
rtoy committed
184 185 186
;;; Revision 1.12  2002/02/17 15:50:17  rtoy
;;; Export with-array-data.
;;;
rtoy's avatar
rtoy committed
187 188 189
;;; Revision 1.11  2002/02/10 03:41:53  rtoy
;;; Export ARRAY-STRINGS type.
;;;
190 191 192 193
;;; Revision 1.10  2002/01/13 16:24:24  rtoy
;;; All of the exported symbols in macros.l have been moved from the F2CL
;;; package to the F2CL-LIB package.
;;;
rtoy's avatar
rtoy committed
194 195 196
;;; Revision 1.9  2002/01/05 18:52:12  rtoy
;;; Add in-package.
;;;
rtoy's avatar
rtoy committed
197 198 199
;;; Revision 1.8  2001/04/26 17:49:50  rtoy
;;; Export new functions D1MACH and R1MACH
;;;
200 201 202 203
;;; Revision 1.7  2001/02/26 15:38:22  rtoy
;;; Move *check-array-bounds* from f2cl1.l to macros.l since the generated
;;; code refers to it.  Export this variable too.
;;;
rtoy's avatar
rtoy committed
204 205 206
;;; Revision 1.6  2000/09/01 13:51:20  rtoy
;;; AMAX1 and DIM were repeated.
;;;
rtoy's avatar
rtoy committed
207 208 209
;;; Revision 1.5  2000/08/05 19:06:34  rtoy
;;; Export F2CL-COMPILE.
;;;
rtoy's avatar
rtoy committed
210 211 212
;;; Revision 1.4  2000/07/28 22:07:44  rtoy
;;; It's FORTRAN, not FORTAN!
;;;
213 214 215 216
;;; Revision 1.3  2000/07/28 16:56:48  rtoy
;;; f2cl0.l isn't the (unused) f2cl loader anymore.  Use it to define the
;;; package used by f2cl.
;;;
217 218 219 220 221
;;; Revision 1.2  2000/07/13 16:55:34  rtoy
;;; To satisfy the Copyright statement, we have placed the RCS logs in
;;; each source file in f2cl.  (Hope this satisfies the copyright.)
;;;
;;;-------------------------------------------------------------------------