source: LMDZ5/trunk/libf/misc/nf95_put_att_m.F90 @ 2927

Last change on this file since 2927 was 1907, checked in by lguez, 11 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: 1.6 KB
Line 
1! $Id$
2module nf95_put_att_m
3
4  implicit none
5
6  interface nf95_put_att
7     module procedure nf95_put_att_text, nf95_put_att_one_FourByteInt
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", ncerr_not_opt, ncid, varid)
35    end if
36
37  end subroutine nf95_put_att_text
38
39  !************************************
40
41  subroutine nf95_put_att_one_FourByteInt(ncid, varid, name, values, ncerr)
42
43    use netcdf, only: nf90_put_att
44    use handle_err_m, only: handle_err
45    use typesizes, only: FourByteInt
46
47    integer, intent(in) :: ncid, varid
48    character(len = *), intent(in) :: name
49    integer(kind = FourByteInt), intent(in) :: values
50    integer, intent(out), optional:: ncerr
51
52    ! Variable local to the procedure:
53    integer ncerr_not_opt
54
55    !-------------------
56
57    ncerr_not_opt = nf90_put_att(ncid, varid, name, values)
58    if (present(ncerr)) then
59       ncerr = ncerr_not_opt
60    else
61       call handle_err("nf95_put_att_one_FourByteInt", ncerr_not_opt, ncid, &
62            varid)
63    end if
64
65  end subroutine nf95_put_att_one_FourByteInt
66
67end module nf95_put_att_m
Note: See TracBrowser for help on using the repository browser.