source: LMDZ4/trunk/libf/bibio/nf95_put_att_m.F90 @ 5428

Last change on this file since 5428 was 1279, checked in by Laurent Fairhead, 15 years ago

Merged LMDZ4-dev branch changes r1241:1278 into the trunk
Running trunk and LMDZ4-dev in LMDZOR configuration on local
machine (sequential) and SX8 (4-proc) yields identical results
(restart and restartphy are identical binarily)
Log history from r1241 to r1278 is available by switching to
source:LMDZ4/branches/LMDZ4-dev-20091210

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.