Previous: VMS Fortran Extensions Up: Porting Fortran Next: Machine Dependencies

VMS-Specific Code

Many current VICAR applications and subroutines have VMS-specific code embedded in them. Some of it is obvious, like a system service call. Some is insidiously difficult to find, like using a double precision floating point value as a single. This works on the VAX because the first half of a double value looks like a float. This is not the case on any other machine.

All the VMS-specific code must, of course, be eliminated or isolated. If the same thing can be done in a portable way, do it that way. If not, then isolate the VMS-specific code and write Unix code to perform the same function. If the function is useful as a general-purpose subroutine, then put it in SUBLIB. If not, include it with your code. See the next section on Machine Dependencies for methods of dealing with machine-dependent code.

An attempt is made below to list the types of VMS-specific code you will run into. This is not and can not be an exhaustive list, as there are far too many potential problem areas that will only be uncovered with more experience. Use this list as examples of what to look out for. You should be familiar with writing portable Fortran code; if not then see a standard Fortran manual (the black type in the VAX Fortran Language Reference Manual is a good source). If in doubt, try it, or ask.