14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
35 use dc_trace, only: beginsub, endsub, dbgmessage
36 implicit none
37 type(gt_variable), intent(in):: var
38 integer, intent(in):: dimord
39 logical, intent(out):: err
40 type(gt_dimmap), allocatable:: map(:)
41 type(gt_dimmap):: tmpmap
42 integer:: ndimsp, stat
43 character(*), parameter:: subname = 'GTVarDelDim'
44continue
45 err = .true.
46 call beginsub(subname)
47 if (dimord < 1) then
48 call endsub(subname, "negative dimord=%d invalid", i=(/dimord/))
49 return
50 endif
52 if (ndimsp <= 0) then
53 call endsub(subname, "variable invalid")
54 return
55 else if (dimord > ndimsp) then
56 call endsub(subname, "dimord=%d not exist", i=(/dimord/))
57 return
58 endif
59
60 allocate(map(ndimsp))
62 tmpmap = map(dimord)
63 map(dimord: ndimsp-1) = map(dimord+1: ndimsp)
64 map(ndimsp) = tmpmap
66 deallocate(map)
67
69 err = stat /= 0
70 call endsub(subname)
subroutine, public map_lookup(var, vid, map, ndims)
subroutine map_set_ndims(var, ndims, stat)
subroutine map_set(var, map, stat)