C Portability

 C.1 Overview
 C.2 Coding and porting prerequisites
 C.3 Operating system specific routines

C.1 Overview

This section discusses the portability of NCAR, including the coding standard adopted and a list of those Starlink packages which need to be ported to the target machine before a port of NCAR can proceed.

C.2 Coding and porting prerequisites

The standard of Fortran used for the coding of NCAR is totally compliant with ANSI Fortran 77. A small number of operating system-specific routines have also been written in ANSI C. To use NCAR on any computer system the operating system specific routines must be modified to reflect the integer and floating point arithmetic used.

NCAR requires either GKS Vn. 7.2 or GKS Vn. 7.4 to be available.

C.3 Operating system specific routines

Several NCAR subroutines make use of operating system features which are specific to the machine upon which they are implemented. The names of these routines and their purpose are as follows:

I1MACH ( I )
: Define INTEGER machine dependent constants.
R1MACH ( I )
: Define REAL machine dependent constants.
ncar.h
: C language versions of the following routines are also available and may be used by a particular implementation: IAND, IOR, ISHIFT. 2 These routines assume a Fortran/C language interface which is defined within the C header file ncar.h. ncar.h will require modification for use on new operating systems.

2The routines IAND and IOR perform logical AND and OR operations between two given INTEGERS. They are often provided by implementations of Fortran 77 as intrinsic functions, but are not featured in the ANSI Standard. C language versions are provided for use with Fortran implementations without IAND and IOR intrinsic functions.