Programmer%27s Manual - OdonataResearchLLC/NASTRAN-95 GitHub Wiki
The Programmer's Manual is currently a place to document the existing
code base as it is audited and modernized. It also serves as a running
commentary on ideas for modernization of the data structures as well
as the code base in general.
Plan of Attack
Make the minimum updates necessary to run all of the demonstration
input.
Modernize the program level code in the mds directory. Treat the
code in mis that compiles to libnastran.a as fixed to the
greatest extent possible. There will be modifications from the
mds level, for example data structures, that will drive changes
in the mis code. But, the intent is not to initiate any
modernization at the mis level.
Once the program level code is modernized, modernize the
organization and data structures in the mis code to use modern
data structures, facilitate extensions, and use 3rd party libraries
(i.e. linear algebra, OpenMP, OpenCL).
Extend and Improve
Observations
Hollerith constants are used extensively throughout the code base
and need to be replaced with characters.
Integers are frequently used to store CHARACTER*4 data and this is
causing issues. It may be an issue with using a 64-bit compiler, but
it might as well be fixed now.
Machine specific code needs to be replaced with platform independent
code.
Need to simplify memory management and replace custom management
routines with standard Fortran 95 methods.
Block Data
The legacy link instructions pull the block data objects out of the
NASTRAN library with ar and compile them with the main program. This
was required so that the initialized data was preserved at the top
level. In NASTRAN-95, the block data files were moved to the BD
directory and compiled separately from the NASTRAN library. This
solution negated having to pull the objects out of the NASTRAN
library. The correct solution is to define the block data in modules
as the code is migrated to Fortran 95.
Machine Constants
The machine constans are defined in subroutine btstrp. The constants
are communicated using the following common blocks.
SYSTEM
LHPWX
MACHIN
CHMACH
The following subroutines should be reviewed when NASTRAN is ported to
a new machine.
PRTPRM
SDCMPS
SDR2E
UPCASE
In common block MACHIN, any subroutine that uses MACHX instead of
MACH contains machine constants that are used locally.
COSMIC/NASTRAN Supported Machines
MACH
Hardware
OS
Supported
1
DUMMY
NO
2
IBM
MVS
YES
3
UNIVAC
FTN
NO
4
CDC
FTN5
NO
5
DEC-VAX
VMS
YES
6
DEC-MIPS
ULTRIX
YES
7
SUN
SOLARIS
YES
8
IBM RS6000
AIX
YES
9
HP
HP-UX
YES
10
SGI
IRIX
YES
11
MACINTOCH
NO
12
CRAY
UNICOS
NO
13
CONVEX
NO
14
NEC
NO
15
FUJITSU
NO
16
SUN
SUNOS
YES
17
AMDAHL
NO
18
PRIME
NO
19
PC
MS-DOS
NO
20
DUMMY
NO
21
DEC-ALPHA
OPENVMS
YES
22
DEC-ALPHA
OSF
YES
Length of NASTRAN I/O Buffer
MACH
Hardware
OS
SYSBUF
1
DUMMY
200
2
IBM
MVS
4100
3
UNIVAC
FTN
871
4
CDC
FTN5
1042
5
DEC-VAX
VMS
1028
6
DEC-MIPS
ULTRIX
1028
7
SUN
SOLARIS
1028
8
IBM RS6000
AIX
1028
9
HP
HP-UX
1028
10
SGI
IRIX
1028
11
MACINTOCH
1028
12
CRAY
UNICOS
2052
13
CONVEX
1028
14
NEC
2052
15
FUJITSU
2052
16
SUN
SUNOS
1028
17
AMDAHL
1028
18
PRIME
1028
19
PC
MS-DOS
1028
20
DUMMY
1028
21
DEC-ALPHA
OPENVMS
1028
22
DEC-ALPHA
OSF
1028
Fortran Unit for Input Data and Printed Output
INTP : Fortran unit for input data
OUTTAP : Fortran unit for printed output
MACH
Hardware
OS
INTP
OUTTAP
1
DUMMY
5
6
2
IBM
MVS
5
6
3
UNIVAC
FTN
5
6
4
CDC
FTN5
5
6
5
DEC-VAX
VMS
5
6
6
DEC-MIPS
ULTRIX
5
6
7
SUN
SOLARIS
5
6
8
IBM RS6000
AIX
5
6
9
HP
HP-UX
5
6
10
SGI
IRIX
5
6
11
MACINTOCH
5
6
12
CRAY
UNICOS
5
6
13
CONVEX
5
6
14
NEC
5
6
15
FUJITSU
5
6
16
SUN
SUNOS
5
6
17
AMDAHL
5
6
18
PRIME
5
6
19
PC
MS-DOS
5
6
20
DUMMY
5
6
21
DEC-ALPHA
OPENVMS
5
6
22
DEC-ALPHA
OSF
5
6
Number of Lines/Page and Words/Input Card
NLPP : Number of lines printed per page
NWPIC : Number of words per input card, used only in XGPIBS
RECL : Direct file record length (used in Fortran OPEN statement);
by words = 1; by byte = NCPW
QP : REAL*16 precision flag; YES = 1; NO = 0
MACH
Hardware
OS
IPREC
RECL
QP
1
DUMMY
2
0
0
2
IBM
MVS
2
4
0
3
UNIVAC
FTN
2
1
0
4
CDC
FTN5
1
1
0
5
DEC-VAX
VMS
2
1
0
6
DEC-MIPS
ULTRIX
2
1
0
7
SUN
SOLARIS
2
4
0
8
IBM RS6000
AIX
2
4
0
9
HP
HP-UX
2
4
0
10
SGI
IRIX
2
1
0
11
MACINTOCH
2
0
0
12
CRAY
UNICOS
1
8
0
13
CONVEX
2
4
0
14
NEC
1
0
0
15
FUJITSU
1
0
0
16
SUN
SUNOS
2
0
0
17
AMDAHL
2
0
0
18
PRIME
2
0
0
19
PC
MS-DOS
2
0
0
20
DUMMY
2
0
0
21
DEC-ALPHA
OPENVMS
2
1
0
22
DEC-ALPHA
OSF
2
0
0
Fortran Units for Punched Data
LPCH : Fortran unit for punched output
LDICT : Fortran unit for restart dictionary punch
MACH
Hardware
OS
LPCH
LDICT
1
DUMMY
7
3
2
IBM
MVS
7
7
3
UNIVAC
FTN
1
3
4
CDC
FTN5
7
7
5
DEC-VAX
VMS
1
4
6
DEC-MIPS
ULTRIX
1
4
7
SUN
SOLARIS
1
4
8
IBM RS6000
AIX
1
4
9
HP
HP-UX
1
4
10
SGI
IRIX
1
4
11
MACINTOCH
1
4
12
CRAY
UNICOS
1
4
13
CONVEX
1
4
14
NEC
1
4
15
FUJITSU
1
4
16
SUN
SUNOS
1
4
17
AMDAHL
1
4
18
PRIME
1
4
19
PC
MS-DOS
1
4
20
DUMMY
1
4
21
DEC-ALPHA
OPENVMS
1
4
22
DEC-ALPHA
OSF
1
4
Numeric Range for Single Precision Real Numbers
Used only by RCARD, RCARD2, XRCARD, and YRCARD. Only HIGHPW
is specified, LOWPW = 1 - HIGHPW.
MACH
Hardware
OS
HIGHPW
1
DUMMY
38
2
IBM
MVS
75
3
UNIVAC
FTN
38
4
CDC
FTN5
321
5
DEC-VAX
VMS
38
6
DEC-MIPS
ULTRIX
38
7
SUN
SOLARIS
38
8
IBM RS6000
AIX
38
9
HP
HP-UX
38
10
SGI
IRIX
38
11
MACINTOCH
38
12
CRAY
UNICOS
2465
13
CONVEX
38
14
NEC
0
15
FUJITSU
0
16
SUN
SUNOS
0
17
AMDAHL
0
18
PRIME
0
19
PC
MS-DOS
0
20
DUMMY
0
21
DEC-ALPHA
OPENVMS
38
22
DEC-ALPHA
OSF
0
Floating Point Underflow and Maxinum Files in NASCAR
NUDFLW : Floating number underflow control, used only by FQRW and
FQRWV MXFL : Maxinum files MAXFIL can request via the NASTRAN
card, used only by NASCAR
MACH
Hardware
OS
NUDFLW
MXFL
1
DUMMY
16
50
2
IBM
MVS
16
50
3
UNIVAC
FTN
18
49
4
CDC
FTN5
14
75
5
DEC-VAX
VMS
8
75
6
DEC-MIPS
ULTRIX
16
75
7
SUN
SOLARIS
16
75
8
IBM RS6000
AIX
16
75
9
HP
HP-UX
16
75
10
SGI
IRIX
16
75
11
MACINTOCH
16
75
12
CRAY
UNICOS
16
75
13
CONVEX
16
75
14
NEC
16
75
15
FUJITSU
16
75
16
SUN
SUNOS
16
75
17
AMDAHL
16
75
18
PRIME
16
75
19
PC
MS-DOS
16
75
20
DUMMY
16
75
21
DEC-ALPHA
OPENVMS
9
75
22
DEC-ALPHA
OSF
16
75
Shift Counts
KSHIFT : Shift counts used in a divide to convert a GINO LOC returned
from SAVPOS to GINO block number, used in EMA.
MACH
Hardware
OS
KSHIFT
1
DUMMY
1
2
IBM
MVS
4096
3
UNIVAC
FTN
4096
4
CDC
FTN5
262144
5
DEC-VAX
VMS
4096
6
DEC-MIPS
ULTRIX
4096
7
SUN
SOLARIS
4096
8
IBM RS6000
AIX
4096
9
HP
HP-UX
4096
10
SGI
IRIX
4096
11
MACINTOCH
4096
12
CRAY
UNICOS
4096
13
CONVEX
4096
14
NEC
0
15
FUJITSU
0
16
SUN
SUNOS
0
17
AMDAHL
0
18
PRIME
0
19
PC
MS-DOS
0
20
DUMMY
0
21
DEC-ALPHA
OPENVMS
4096
22
DEC-ALPHA
OSF
0
Mantissa Bits
MTISA : Used on in SDCMPS
MACH
Hardware
OS
SP
DP
1
DUMMY
0
00
2
IBM
MVS
24
26
3
UNIVAC
FTN
27
60
4
CDC
FTN5
48
96
5
DEC-VAX
VMS
23
55
6
DEC-MIPS
ULTRIX
23
55
7
SUN
SOLARIS
23
52
8
IBM RS6000
AIX
23
55
9
HP
HP-UX
23
55
10
SGI
IRIX
23
55
11
MACINTOCH
23
55
12
CRAY
UNICOS
48
96
13
CONVEX
23
52
14
NEC
48
96
15
FUJITSU
48
96
16
SUN
SUNOS
23
55
17
AMDAHL
23
55
18
PRIME
23
55
19
PC
MS-DOS
0
00
20
DUMMY
0
00
21
DEC-ALPHA
OPENVMS
23
55
22
DEC-ALPHA
OSF
0
00
File Control Block (FCB)
The File Control Block (FCB) is used by the NASTRAN program code in
the mds directory. The main issue with the FCB array is that it is
an integer array, but elements 13 and 14 are used to store character
data. The format of the FCB was taken from the file mis/gnfiat.f.
Fortran INTEGER FCB COMMON / FCB / FCB(17,MAXFCB)
Index
Description
Notes
1
Open Flag (0 - Read, 1 - Write)
2
Buffer Address
3
Current Logical Record (CLR)
4
Current Block Number
5
First Block Number on External File
6
Last Block Number on External File
7
Number of Blocks Allocated to this File
8
Flag for Writing the First Column on File (0-NO, 1-YES)
9
Index to First In-Memory Block
10
Index to Last In-Memory Block
11
Index to Current In-Memory Block
12
Original Buffer Address (ON Open)
13,14
DMAP File Name
Implicit coercion of CHARACTER*4 data to each integer element
15
Open Flag for External File
16
Total Number of Strings in this Matrix
17
Total Number of Terms in this Matrix
MSGX Common Block
The MSGX common block in the mis directory causes a segmentation
fault trying to implicitly convert integer to character data in
SUBROUTINE MESAGE. Fortran COMMON /MSGX / N,M,MSG(4,1)