source: LMDZ5/tags/proto-testing-20131015/tools/Max_diff_nc_with_lib/NetCDF95/nf95_put_att.f90 @ 2300

Last change on this file since 2300 was 1795, checked in by Ehouarn Millour, 11 years ago

Version testing basee sur la r1794


Testing release based on r1794

File size: 2.5 KB
Line 
1module nf95_put_att_m
2
3  implicit none
4
5  interface nf95_put_att
6     module procedure nf95_put_att_text, nf95_put_att_one_FourByteInt, &
7          nf95_put_att_one_FourByteReal
8  end interface
9
10  private
11  public nf95_put_att
12
13contains
14
15  subroutine nf95_put_att_text(ncid, varid, name, values, ncerr)
16
17    use netcdf, only: nf90_put_att
18    use handle_err_m, only: handle_err
19
20    integer, intent(in) :: ncid, varid
21    character(len = *), intent(in) :: name
22    character(len = *), intent(in) :: values
23    integer, intent(out), optional:: ncerr
24
25    ! Variable local to the procedure:
26    integer ncerr_not_opt
27
28    !-------------------
29
30    ncerr_not_opt = nf90_put_att(ncid, varid, name, values)
31    if (present(ncerr)) then
32       ncerr = ncerr_not_opt
33    else
34       call handle_err("nf95_put_att_text " // trim(name), ncerr_not_opt, &
35            ncid, varid)
36    end if
37
38  end subroutine nf95_put_att_text
39
40  !************************************
41
42  subroutine nf95_put_att_one_FourByteInt(ncid, varid, name, values, ncerr)
43
44    use netcdf, only: nf90_put_att
45    use handle_err_m, only: handle_err
46    use typesizes, only: FourByteInt
47
48    integer, intent(in) :: ncid, varid
49    character(len = *), intent(in) :: name
50    integer(kind = FourByteInt), intent(in) :: values
51    integer, intent(out), optional:: ncerr
52
53    ! Variable local to the procedure:
54    integer ncerr_not_opt
55
56    !-------------------
57
58    ncerr_not_opt = nf90_put_att(ncid, varid, name, values)
59    if (present(ncerr)) then
60       ncerr = ncerr_not_opt
61    else
62       call handle_err("nf95_put_att_one_FourByteInt " // trim(name), &
63            ncerr_not_opt, ncid, varid)
64    end if
65
66  end subroutine nf95_put_att_one_FourByteInt
67
68  !************************************
69
70  subroutine nf95_put_att_one_FourByteReal(ncid, varid, name, values, ncerr)
71
72    use netcdf, only: nf90_put_att
73    use handle_err_m, only: handle_err
74    use typesizes, only: FourByteReal
75
76    integer, intent(in) :: ncid, varid
77    character(len = *), intent(in) :: name
78    real(kind = FourByteReal), intent(in) :: values
79    integer, intent(out), optional:: ncerr
80
81    ! Variable local to the procedure:
82    integer ncerr_not_opt
83
84    !-------------------
85
86    ncerr_not_opt = nf90_put_att(ncid, varid, name, values)
87    if (present(ncerr)) then
88       ncerr = ncerr_not_opt
89    else
90       call handle_err("nf95_put_att_one_FourByteReal " // trim(name), &
91            ncerr_not_opt, ncid, varid)
92    end if
93
94  end subroutine nf95_put_att_one_FourByteReal
95
96end module nf95_put_att_m
Note: See TracBrowser for help on using the repository browser.