gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
gtvardeldim.f90
Go to the documentation of this file.
1
21
58subroutine gtvardeldim(var, dimord, err)
59 use gtdata_types, only: gt_variable
62 implicit none
63 type(gt_variable), intent(in):: var
64 integer, intent(in):: dimord
65 logical, intent(out):: err
66 type(gt_dimmap), allocatable:: map(:)
67 type(gt_dimmap):: tmpmap
68 integer:: ndimsp, stat
69 character(*), parameter:: subname = 'GTVarDelDim'
70continue
71 err = .true.
72 call beginsub(subname)
73 if (dimord < 1) then
74 call endsub(subname, "negative dimord=%d invalid", i=(/dimord/))
75 return
76 endif
77 call map_lookup(var, ndims=ndimsp)
78 if (ndimsp <= 0) then
79 call endsub(subname, "variable invalid")
80 return
81 else if (dimord > ndimsp) then
82 call endsub(subname, "dimord=%d not exist", i=(/dimord/))
83 return
84 endif
85
86 allocate(map(ndimsp))
87 call map_lookup(var, map=map)
88 tmpmap = map(dimord)
89 map(dimord: ndimsp-1) = map(dimord+1: ndimsp)
90 map(ndimsp) = tmpmap
91 call map_set(var, map, stat)
92 deallocate(map)
93
94 call map_set_ndims(var, ndims = ndimsp - 1, stat=stat)
95 err = stat /= 0
96 call endsub(subname)
97end subroutine gtvardeldim
subroutine gtvardeldim(var, dimord, err)
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:661
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
subroutine, public map_lookup(var, vid, map, ndims)
subroutine map_set_ndims(var, ndims, stat)
subroutine map_set(var, map, stat)