File: f90aux.m4

package info (click to toggle)
netcdf-fortran 4.5.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,456 kB
  • sloc: fortran: 25,848; f90: 20,793; sh: 4,609; ansic: 1,729; makefile: 585; pascal: 292; xml: 173
file content (50 lines) | stat: -rw-r--r-- 2,329 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
divert(-1)dnl
ifdef(`NUMDIMS',,
	`errprint(`****NUMDIMS should be defined as 0, 1, 2, 3, 4, 5, 6, 7, ...****')m4exit')dnl
ifdef(`KINDVALUE',,
	`errprint(`****KINDVALUE must be defined as  "text", "OneByteInt", "TwoBytInt", "FourByteInt", "EightByteInt", "FourByteReal", or "EightByteReal"****\n')m4exit')dnl
ifdef(`PUTORGET',,
	`errprint(`****PUTORGET must be defined as "put" or "get"****\n')m4exit')dnl
dnl# NCOLONS(1) = ":", NCOLONS(2) = ":, :", etc.
define(`NCOLONS',`ifelse($1, 1, `:', `:, '`NCOLONS(decr($1))')')
define(`COLONS',`NCOLONS(NUMDIMS)')
define(`NUMERIC_DECL',`$1 (kind = KINDVALUE)')
define(`TEXT_DEFINES',
	`define(`TYPE',`character (len = *)')define(`NCKIND',`text')')
define(`INT1_DEFINES',
	`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int1')')
define(`INT2_DEFINES',
	`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int2')')
define(`INT4_DEFINES',
	`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int')')
define(`INT8_DEFINES',
	`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int')')
define(`FLT4_DEFINES',
	`define(`TYPE',`NUMERIC_DECL(real)')define(`NCKIND',`real')')
define(`FLT8_DEFINES',
	`define(`TYPE',`NUMERIC_DECL(real)')define(`NCKIND',`double')')
ifelse(KINDVALUE,text,`TEXT_DEFINES',
       KINDVALUE,OneByteInt,`INT1_DEFINES',
       KINDVALUE,TwoByteInt,`INT2_DEFINES',
       KINDVALUE,FourByteInt,`INT4_DEFINES',
       KINDVALUE,EightByteInt,`INT8_DEFINES',
       KINDVALUE,FourByteReal,`FLT4_DEFINES',
       KINDVALUE,EightByteReal,`FLT8_DEFINES',
       
	`errprint(`****KINDVALUE must be "text", "OneByteInt", "TwoBytInt", "FourByteInt", "EightByteInt", "FourByteReal", or "EightByteReal"****\n')')
ifelse(PUTORGET,`put',`define(`IN_OR_OUT',` in')',
       PUTORGET,`get',`define(`IN_OR_OUT',`out')',
       
	`errprint(`****PUTORGET must be "put" or "get"****')')
define(`ND_KINDVALUE',NUMDIMS`'D_`'KINDVALUE)
define(`NF90_AFUN',`nf90_'PUTORGET`_var_'ND_KINDVALUE)
define(`NF90_1FUN',`nf90_'PUTORGET`_var_'KINDVALUE)
define(`NF_MFUN',`nf_'PUTORGET`_varm_'NCKIND)
define(`NF_SFUN',`nf_'PUTORGET`_vars_'NCKIND)
define(`NF_AFUN',`nf_'PUTORGET`_vara_'NCKIND)
define(`NF_1FUN',`nf_'PUTORGET`_var1_'NCKIND)
define(`m4_rename',`ifdef(`$1',`define(`m4'_`$1',defn(`$1'))undefine(`$1')')')
m4_rename(`index')
m4_rename(`len')
m4_rename(`shift')
divert`'dnl