source: LMDZ6/trunk/tools/netcdf95/Groups/nf95_inq_grp_full_ncid.f90 @ 5407

Last change on this file since 5407 was 4918, checked in by Laurent Fairhead, 8 months ago

Reintegrated NetCDF95 in LMDZ so that it is compiled and made available by the makelmdz_fcm script.
The makelmdz_fcm creates the libnetcdf95 library and copies it in the tools/netcdf/lib directory, copying
the mod files in the tools/netcdf/include library.

File size: 1.7 KB
Line 
1module nf95_inq_grp_full_ncid_m
2
3  implicit none
4
5contains
6
7  subroutine nf95_inq_grp_full_ncid(ncid, full_name, grp_ncid, ncerr)
8
9    use, intrinsic:: ISO_C_BINDING
10
11    use nc_constants, only: NC_NOERR
12    use nf95_abort_m, only: nf95_abort
13    use nf95_constants, only: nf95_noerr
14
15    integer, intent(in):: ncid ! can be the file id or a group id
16
17    character(len = *), intent(in):: full_name
18    ! Should be a path relative to ncid (which can correspond to the
19    ! root group or a subgroup). Can be an immediate subgroup or a
20    ! deeper subgroup.
21
22    integer, intent(out):: grp_ncid
23    integer, intent(out), optional:: ncerr
24
25    ! Local:
26    Integer(C_INT) cncerr, cgrp_ncid
27
28    Interface
29       Integer(C_INT) Function nc_inq_grp_full_ncid(cncid, full_name, &
30            cgrp_ncid) BIND(C)
31         import c_int, C_CHAR
32         Integer(C_INT), VALUE, Intent(IN):: cncid
33         Character(KIND=C_CHAR), Intent(IN):: full_name(*)
34         Integer(C_INT), Intent(ouT) :: cgrp_ncid
35       End Function nc_inq_grp_full_ncid
36    end Interface
37
38    !------------------------------------------------------------
39
40    ! We assume that the C character kind is the same as the default
41    ! character kind:
42    cncerr = nc_inq_grp_full_ncid(int(ncid, c_int), full_name // c_null_char, &
43         cgrp_ncid)
44
45    if (cncerr == NC_NOERR) then
46       grp_ncid = cgrp_ncid
47       if (present(ncerr)) ncerr = nf95_noerr
48    else
49       if (present(ncerr)) then
50          ncerr = cncerr
51       else
52          call nf95_abort("nf95_inq_grp_full_ncid " // trim(full_name), &
53            int(cncerr), ncid)
54       end if
55    end if
56
57  end subroutine nf95_inq_grp_full_ncid
58
59end module nf95_inq_grp_full_ncid_m
Note: See TracBrowser for help on using the repository browser.