gdncvarattrcopy.f90
Go to the documentation of this file.
1 ! Copyright (C) GFD Dennou Club, 2000. All rights reserved.
2 
3 subroutine gdncvarattrcopy(to, attrname, from, stat)
8  use netcdf, only: nf90_noerr, nf90_max_name, nf90_copy_att
9  use dc_url, only: gt_plus
10  use dc_error
11  implicit none
12  type(gd_nc_variable), intent(in):: to
13  character(len = *), intent(in):: attrname
14  type(gd_nc_variable), intent(in):: from
15  integer, intent(out):: stat
16  character(NF90_MAX_NAME):: nc_aname
17  integer:: id_var_from, id_var_to
18  logical:: myerr
19  type(gd_nc_variable_entry):: to_ent, from_ent
20  stat = vtable_lookup(to, to_ent)
21  if (stat /= nf90_noerr) goto 999
22  stat = vtable_lookup(from, from_ent)
23  if (stat /= nf90_noerr) goto 999
24  stat = gdncfiledefinemode(to_ent%fileid)
25  if (stat /= nf90_noerr) goto 999
26  call inquireplus(from, attrname, id_var_from, nc_aname)
27  call inquireplus(to, attrname, id_var_to, nc_aname)
28  stat = nf90_copy_att(from_ent%fileid, id_var_from, nc_aname, to_ent%fileid, id_var_to)
29 999 continue
30  call storeerror(stat, "GDNcVarAttrCopy", myerr)
31  return
32 end subroutine gdncvarattrcopy
integer function, public vtable_lookup(var, entry)
integer function gdncfiledefinemode(fileid)
character, parameter, public gt_plus
Definition: dc_url.f90:92
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
subroutine gdncvarattrcopy(to, attrname, from, stat)