source: LMDZ6/trunk/tools/netcdf95/Groups/nf95_inq_grp_parent.f90 @ 5075

Last change on this file since 5075 was 5075, checked in by abarral, 4 months ago

[continued & end] replace netcdf by lmdz_netcdf.F90 wrapper
"use netcdf" is now only used in lmdz_netcdf.F90 (except ecrad and obsolete/)
<include "netcdf.inc"> is now likewise only used in lmdz_netcdf.F90.

systematically specify explicitely <USE lmdz_netcdf, ONLY:> (probably left some missing, to correct later on)

Further replacement of nf_put_* by nf90_put_* (same for _get_)

[minor] replace deprecated boolean operators along the way

File size: 1.3 KB
Line 
1module nf95_inq_grp_parent_m
2
3  implicit none
4
5contains
6
7  subroutine nf95_inq_grp_parent(ncid, parent_ncid, ncerr)
8
9    ! Note that this procedure is indirectly called by nf95_abort, so
10    ! it cannot call it.
11
12    use, intrinsic:: ISO_C_BINDING
13
14    use lmdz_netcdf, only: nf90_strerror
15
16    use nc_constants, only: NC_NOERR
17    use nf95_constants, only: nf95_noerr
18
19    integer, intent(in):: ncid
20    integer, intent(out):: parent_ncid
21    integer, intent(out), optional:: ncerr
22
23    ! Local:
24
25    Integer(C_INT) cparent_ncid, cncerr
26
27    Interface
28       Integer(C_INT) Function nc_inq_grp_parent(cncid, cparent_ncid) BIND(C)
29         import c_int
30         Integer(C_INT), VALUE:: cncid
31         Integer(C_INT), Intent(OUT) :: cparent_ncid
32       End Function nc_inq_grp_parent
33    End Interface
34
35    !------------------------------------------------------------
36
37    cncerr = nc_inq_grp_parent(int(ncid, c_int), cparent_ncid)
38
39    if (cncerr == NC_NOERR) then
40       parent_ncid = cparent_ncid
41       if (present(ncerr)) ncerr = nf95_noerr
42    else
43       if (present(ncerr)) then
44          ncerr = cncerr
45       else
46          print *, "nf95_inq_grp_parent:"
47          print *, trim(nf90_strerror(int(cncerr)))
48          stop 1
49       end if
50    end if
51
52  end subroutine nf95_inq_grp_parent
53
54end module nf95_inq_grp_parent_m
Note: See TracBrowser for help on using the repository browser.