source: LMDZ4/trunk/libf/bibio/i1mach.F @ 3675

Last change on this file since 3675 was 1425, checked in by lguez, 14 years ago

Replaced Numerical Recipes procedures for spline interpolation (not in
the public domain) by procedures from the Pchip package in the Slatec
library. This only affects the program "ce0l", not the program
"gcm". Tested on Brodie SX8 with "-debug" and "-prod", "-parallel
none" and "-parallel mpi". "start.nc" and "limit.nc" are
changed. "startphy.nc" is not changed. The relative change is of order
1e-7 or less. The revision makes the program faster (tested on Brodie
with "-prod -d 144x142x39", CPU time is 38 s, instead of 54
s). Procedures from Slatec are untouched, except for
"i1mach.F". Created procedures "pchfe_95" and "pchsp_95" which are
wrappers for "pchfe" and "pchsp" from Slatec. "pchfe_95" and
"pchsp_95" have a safer and simpler interface.

Replaced "make" by "sxgmake" in "arch-SX8_BRODIE.fcm". Added files for
compilation by FCM with "g95".

In "arch-linux-32bit.fcm", replaced "pgf90" by "pgf95". There was no
difference between "dev" and "debug" so added "-O1" to "dev". Added
debugging options. Removed "-Wl,-Bstatic
-L/usr/lib/gcc-lib/i386-linux/2.95.2", which usually produces an error
at link-time.

Bash is now ubiquitous while KornShell? is not so use Bash instead of
KornShell? in FCM.

Replaced some statements "write(6,*)" by "write(lunout,*)". Replaced
"stop" by "stop 1" in the case where "abort_gcm" is called with "ierr
/= 0". Removed "stop" statements at the end of procedures
"limit_netcdf" and main program "ce0l" (why not let the program end
normally?).

Made some arrays automatic instead of allocatable in "start_inter_3d".

Zeroed "wake_pe", "fm_therm", "entr_therm" and "detr_therm" in
"dyn3dpar/etat0_netcdf.F90". The parallel and sequential results of
"ce0l" are thus identical.

File size: 4.4 KB
RevLine 
[1425]1*DECK I1MACH
2      INTEGER FUNCTION I1MACH (I)
3C***BEGIN PROLOGUE  I1MACH
4C***PURPOSE  Return integer machine dependent constants.
5C***LIBRARY   SLATEC
6C***CATEGORY  R1
7C***TYPE      INTEGER (I1MACH-I)
8C***KEYWORDS  MACHINE CONSTANTS
9C***AUTHOR  Fox, P. A., (Bell Labs)
10C           Hall, A. D., (Bell Labs)
11C           Schryer, N. L., (Bell Labs)
12C***DESCRIPTION
13C
14C   I1MACH can be used to obtain machine-dependent parameters for the
15C   local machine environment.  It is a function subprogram with one
16C   (input) argument and can be referenced as follows:
17C
18C        K = I1MACH(I)
19C
20C   where I=1,...,16.  The (output) value of K above is determined by
21C   the (input) value of I.  The results for various values of I are
22C   discussed below.
23C
24C   I/O unit numbers:
25C     I1MACH( 1) = the standard input unit.
26C     I1MACH( 2) = the standard output unit.
27C     I1MACH( 3) = the standard punch unit.
28C     I1MACH( 4) = the standard error message unit.
29C
30C   Words:
31C     I1MACH( 5) = the number of bits per integer storage unit.
32C     I1MACH( 6) = the number of characters per integer storage unit.
33C
34C   Integers:
35C     assume integers are represented in the S-digit, base-A form
36C
37C                sign ( X(S-1)*A**(S-1) + ... + X(1)*A + X(0) )
38C
39C                where 0 .LE. X(I) .LT. A for I=0,...,S-1.
40C     I1MACH( 7) = A, the base.
41C     I1MACH( 8) = S, the number of base-A digits.
42C     I1MACH( 9) = A**S - 1, the largest magnitude.
43C
44C   Floating-Point Numbers:
45C     Assume floating-point numbers are represented in the T-digit,
46C     base-B form
47C                sign (B**E)*( (X(1)/B) + ... + (X(T)/B**T) )
48C
49C                where 0 .LE. X(I) .LT. B for I=1,...,T,
50C                0 .LT. X(1), and EMIN .LE. E .LE. EMAX.
51C     I1MACH(10) = B, the base.
52C
53C   Single-Precision:
54C     I1MACH(11) = T, the number of base-B digits.
55C     I1MACH(12) = EMIN, the smallest exponent E.
56C     I1MACH(13) = EMAX, the largest exponent E.
57C
58C   Double-Precision:
59C     I1MACH(14) = T, the number of base-B digits.
60C     I1MACH(15) = EMIN, the smallest exponent E.
61C     I1MACH(16) = EMAX, the largest exponent E.
62C
63C   To alter this function for a particular environment, the desired
64C   set of DATA statements should be activated by removing the C from
65C   column 1.  Also, the values of I1MACH(1) - I1MACH(4) should be
66C   checked for consistency with the local operating system.
67C
68C***REFERENCES  P. A. Fox, A. D. Hall and N. L. Schryer, Framework for
69C                 a portable library, ACM Transactions on Mathematical
70C                 Software 4, 2 (June 1978), pp. 177-188.
71C***ROUTINES CALLED  (NONE)
72C***REVISION HISTORY  (YYMMDD)
73C   750101  DATE WRITTEN
74C   891012  Added VAX G-floating constants.  (WRB)
75C   891012  REVISION DATE from Version 3.2
76C   891214  Prologue converted to Version 4.0 format.  (BAB)
77C   900618  Added DEC RISC constants.  (WRB)
78C   900723  Added IBM RS 6000 constants.  (WRB)
79C   901009  Correct I1MACH(7) for IBM Mainframes. Should be 2 not 16.
80C           (RWC)
81C   910710  Added HP 730 constants.  (SMR)
82C   911114  Added Convex IEEE constants.  (WRB)
83C   920121  Added SUN -r8 compiler option constants.  (WRB)
84C   920229  Added Touchstone Delta i860 constants.  (WRB)
85C   920501  Reformatted the REFERENCES section.  (WRB)
86C   920625  Added Convex -p8 and -pd8 compiler option constants.
87C           (BKS, WRB)
88C   930201  Added DEC Alpha and SGI constants.  (RWC and WRB)
89C   930618  Corrected I1MACH(5) for Convex -p8 and -pd8 compiler
90C           options.  (DWL, RWC and WRB).
91C   100623  Use Fortran 95 intrinsic functions (Lionel GUEZ)
92C***END PROLOGUE  I1MACH
93C
94      INTEGER IMACH(16),OUTPUT
95      SAVE IMACH
96      EQUIVALENCE (IMACH(4),OUTPUT)
97C***FIRST EXECUTABLE STATEMENT  I1MACH
98      IMACH( 1) =         5
99      IMACH( 2) =         6
100      IMACH( 3) =         6
101      IMACH( 4) =         6
102      IMACH( 5) =        bit_size(0)
103      IMACH( 6) =         IMACH( 5) / 8
104      IMACH( 7) =         radix(0)
105      IMACH( 8) =        digits(0)
106      IMACH( 9) =     huge(0)
107      IMACH(10) =         radix(0.)
108      IMACH(11) =        digits(0.)
109      IMACH(12) =      minexponent(0.)
110      IMACH(13) =       maxexponent(0.)
111      IMACH(14) =        digits(0d0)
112      IMACH(15) =      minexponent(0d0)
113      IMACH(16) =       maxexponent(0d0)
114      IF (I .LT. 1  .OR.  I .GT. 16) GO TO 10
115C
116      I1MACH = IMACH(I)
117      RETURN
118C
119   10 CONTINUE
120      WRITE (UNIT = OUTPUT, FMT = 9000)
121 9000 FORMAT ('1ERROR    1 IN I1MACH - I OUT OF BOUNDS')
122C
123C     CALL FDUMP
124C
125      STOP
126      END
Note: See TracBrowser for help on using the repository browser.