source: LMDZ5/trunk/tools/Max_diff_nc_with_lib/NetCDF95/nf95_put_att.f90 @ 1907

Last change on this file since 1907 was 1907, checked in by lguez, 10 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
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.