gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
Functions/Subroutines
gdncvarattrcopy.f90 File Reference

netCDF 変数間で属性をコピー More...

Go to the source code of this file.

Functions/Subroutines

subroutine gdncvarattrcopy (to, attrname, from, stat)
 

Detailed Description

netCDF 変数間で属性をコピー

Author
GFD Dennou Club

Definition in file gdncvarattrcopy.f90.

Function/Subroutine Documentation

◆ gdncvarattrcopy()

subroutine gdncvarattrcopy ( type(gd_nc_variable), intent(in)  to,
character(len = *), intent(in)  attrname,
type(gd_nc_variable), intent(in)  from,
integer, intent(out)  stat 
)

指定された属性を変数間でコピー

ソース変数からデスティネーション変数へ属性をコピーします。

Parameters
[in]toコピー先変数ハンドル
[in]attrname属性名
[in]fromコピー元変数ハンドル
[out]statステータスコード

Definition at line 34 of file gdncvarattrcopy.f90.

39 use netcdf, only: nf90_noerr, nf90_max_name, nf90_copy_att
40 use dc_error
41 implicit none
42 type(GD_NC_VARIABLE), intent(in):: to
43 character(len = *), intent(in):: attrname
44 type(GD_NC_VARIABLE), intent(in):: from
45 integer, intent(out):: stat
46 character(NF90_MAX_NAME):: nc_aname
47 integer:: id_var_from, id_var_to
48 logical:: myerr
49 type(GD_NC_VARIABLE_ENTRY):: to_ent, from_ent
50 stat = vtable_lookup(to, to_ent)
51 if (stat /= nf90_noerr) goto 999
52 stat = vtable_lookup(from, from_ent)
53 if (stat /= nf90_noerr) goto 999
54 stat = gdncfiledefinemode(to_ent%fileid)
55 if (stat /= nf90_noerr) goto 999
56 call inquireplus(from, attrname, id_var_from, nc_aname)
57 call inquireplus(to, attrname, id_var_to, nc_aname)
58 stat = nf90_copy_att(from_ent%fileid, id_var_from, nc_aname, to_ent%fileid, id_var_to)
59999 continue
60 call storeerror(stat, "GDNcVarAttrCopy", myerr)
61 return
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer function, public vtable_lookup(var, entry)

References dc_error::storeerror(), and gtdata_netcdf_internal::vtable_lookup().

Here is the call graph for this function: