1 | #include <stdio.h> |
---|
2 | |
---|
3 | #ifndef CRAY |
---|
4 | # ifdef NOUNDERSCORE |
---|
5 | # define WRF_NUM_BYTES_BETWEEN wrf_num_bytes_between |
---|
6 | # define GET_INITIAL_DATA_VALUE get_initial_data_value |
---|
7 | # define WHAT_IS_A_NAN what_is_a_nan |
---|
8 | # define WRF_MEM_COPY wrf_mem_copy |
---|
9 | # else |
---|
10 | # ifdef F2CSTYLE |
---|
11 | # define WRF_NUM_BYTES_BETWEEN wrf_num_bytes_between__ |
---|
12 | # define GET_INITIAL_DATA_VALUE get_initial_data_value__ |
---|
13 | # define WHAT_IS_A_NAN what_is_a_nan__ |
---|
14 | # define WRF_MEM_COPY wrf_mem_copy__ |
---|
15 | # else |
---|
16 | # define WRF_NUM_BYTES_BETWEEN wrf_num_bytes_between_ |
---|
17 | # define GET_INITIAL_DATA_VALUE get_initial_data_value_ |
---|
18 | # define WHAT_IS_A_NAN what_is_a_nan_ |
---|
19 | # define WRF_MEM_COPY wrf_mem_copy_ |
---|
20 | # endif |
---|
21 | # endif |
---|
22 | #endif |
---|
23 | |
---|
24 | void |
---|
25 | WRF_NUM_BYTES_BETWEEN ( a , b , n ) |
---|
26 | char * a ; |
---|
27 | char * b ; |
---|
28 | int * n ; |
---|
29 | { |
---|
30 | *n = a - b ; |
---|
31 | if ( *n < 0 ) *n = -(*n) ; |
---|
32 | } |
---|
33 | |
---|
34 | /*#define NAN_VALUE */ |
---|
35 | #ifdef NAN_VALUE |
---|
36 | void |
---|
37 | GET_INITIAL_DATA_VALUE ( n ) |
---|
38 | int * n ; |
---|
39 | { |
---|
40 | *n = 0xffc00000 ; |
---|
41 | } |
---|
42 | #else |
---|
43 | void |
---|
44 | GET_INITIAL_DATA_VALUE ( n ) |
---|
45 | float * n ; |
---|
46 | { |
---|
47 | *n = 0. ; |
---|
48 | } |
---|
49 | #endif |
---|
50 | |
---|
51 | void |
---|
52 | WHAT_IS_A_NAN ( n ) |
---|
53 | int * n ; |
---|
54 | { |
---|
55 | *n = 0xffc00000 ; |
---|
56 | #if 0 |
---|
57 | *n = 0. ; |
---|
58 | fprintf(stderr,"WHAT_IS_NAN disabled\n") ; |
---|
59 | #endif |
---|
60 | } |
---|
61 | |
---|
62 | /* SUBROUTINE wrf_mem_copy( a, b, n ) |
---|
63 | INTEGER*1, INTENT (INOUT) :: a(*), b(*) |
---|
64 | INTEGER, INTENT (IN) :: n |
---|
65 | INTEGER :: i |
---|
66 | DO i = 1, n |
---|
67 | b(i) = a(i) |
---|
68 | ENDDO |
---|
69 | RETURN |
---|
70 | END SUBROUTINE wrf_mem_copy */ |
---|
71 | |
---|
72 | void |
---|
73 | WRF_MEM_COPY ( a , b, n ) |
---|
74 | char * a ; |
---|
75 | char * b ; |
---|
76 | int * n ; |
---|
77 | { |
---|
78 | int i ; |
---|
79 | for ( i = 0 ; i < *n ; i++ ) |
---|
80 | { |
---|
81 | *b++ = *a++ ; |
---|
82 | } |
---|
83 | } |
---|
84 | |
---|