1 | ! $Id$ |
---|
2 | module nf95_def_var_m |
---|
3 | |
---|
4 | implicit none |
---|
5 | |
---|
6 | interface nf95_def_var |
---|
7 | module procedure nf95_def_var_oneDim, nf95_def_var_ManyDims |
---|
8 | end interface |
---|
9 | |
---|
10 | private |
---|
11 | public nf95_def_var |
---|
12 | |
---|
13 | contains |
---|
14 | |
---|
15 | subroutine nf95_def_var_oneDim(ncid, name, xtype, dimids, varid, ncerr) |
---|
16 | |
---|
17 | use netcdf, only: nf90_def_var |
---|
18 | use handle_err_m, only: handle_err |
---|
19 | |
---|
20 | integer, intent( in) :: ncid |
---|
21 | character (len = *), intent( in) :: name |
---|
22 | integer, intent( in) :: xtype |
---|
23 | integer, intent( in) :: dimids |
---|
24 | integer, intent(out) :: varid |
---|
25 | integer, intent(out), optional:: ncerr |
---|
26 | |
---|
27 | ! Variable local to the procedure: |
---|
28 | integer ncerr_not_opt |
---|
29 | |
---|
30 | !------------------- |
---|
31 | |
---|
32 | ncerr_not_opt = nf90_def_var(ncid, name, xtype, dimids, varid) |
---|
33 | if (present(ncerr)) then |
---|
34 | ncerr = ncerr_not_opt |
---|
35 | else |
---|
36 | call handle_err("nf95_def_var_oneDim " // name, ncerr_not_opt, ncid) |
---|
37 | end if |
---|
38 | |
---|
39 | end subroutine nf95_def_var_oneDim |
---|
40 | |
---|
41 | !*********************** |
---|
42 | |
---|
43 | subroutine nf95_def_var_ManyDims(ncid, name, xtype, dimids, varid, ncerr) |
---|
44 | |
---|
45 | use netcdf, only: nf90_def_var |
---|
46 | use handle_err_m, only: handle_err |
---|
47 | |
---|
48 | integer, intent( in) :: ncid |
---|
49 | character (len = *), intent( in) :: name |
---|
50 | integer, intent( in) :: xtype |
---|
51 | integer, dimension(:), intent( in) :: dimids |
---|
52 | integer, intent(out) :: varid |
---|
53 | integer, intent(out), optional:: ncerr |
---|
54 | |
---|
55 | ! Variable local to the procedure: |
---|
56 | integer ncerr_not_opt |
---|
57 | |
---|
58 | !------------------- |
---|
59 | |
---|
60 | ncerr_not_opt = nf90_def_var(ncid, name, xtype, dimids, varid) |
---|
61 | if (present(ncerr)) then |
---|
62 | ncerr = ncerr_not_opt |
---|
63 | else |
---|
64 | call handle_err("nf95_def_var_ManyDims " // name, ncerr_not_opt, ncid) |
---|
65 | end if |
---|
66 | |
---|
67 | end subroutine nf95_def_var_ManyDims |
---|
68 | |
---|
69 | end module nf95_def_var_m |
---|