gdmemvarattrdel.f90
Go to the documentation of this file.
1 subroutine gdmemvarattrdel(var, name, err)
4  use dc_error, only: storeerror
5  use netcdf, only: nf90_enotatt, nf90_noerr
6  type(gd_mem_variable), intent(in):: var
7  character(len = *), intent(in):: name
8  logical, intent(out), optional:: err
9  type(gd_mem_variable_entry), pointer:: ent
10  type(gd_mem_attr_chain), pointer:: p, prev
11  integer:: stat
12  stat = memtab_lookup(var, ent)
13  if (stat /= nf90_noerr) goto 999
14  nullify(prev)
15  p => ent%attr
16  do
17  if (.not. associated(p)) exit
18  if (p%name == name) then
19  if (associated(p%cbuf)) deallocate(p%cbuf)
20  prev%next => p%next
21  deallocate(p)
22  call storeerror(nf90_noerr, "GDMemVarAttrDel", err)
23  return
24  endif
25  prev => p
26  p => p%next
27  enddo
28  stat = nf90_enotatt
29 999 continue
30  call storeerror(stat, "GDMemVarAttrDel", err, cause_c=name)
31 end subroutine gdmemvarattrdel
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
subroutine gdmemvarattrdel(var, name, err)