source: LMDZ4/branches/LMDZ4-dev/libf/bibio/nf95_def_var_m.F90 @ 1211

Last change on this file since 1211 was 1157, checked in by Laurent Fairhead, 16 years ago

Le makegcm traditionnel ne sait pas gérer les *.f90
FH/LF

File size: 1.8 KB
Line 
1! $Id$
2module 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
13contains
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
69end module nf95_def_var_m
Note: See TracBrowser for help on using the repository browser.