32 use netcdf
, only: nf90_noerr, nf90_float, nf90_int, nf90_double, nf90_char, &
33 & nf90_def_var, nf90_def_dim
38 character(len = *),
intent(in):: url
39 character(len = *),
intent(in):: xtype
40 integer,
intent(in):: length
41 logical,
intent(in),
optional:: overwrite
42 logical,
intent(out),
optional:: err
44 character(len = string):: filename, varname, cause_c
47 character(len = *),
parameter:: subname =
"GDNcVarCreateD" 49 call beginsub(subname,
'url=<%c>, xtype=<%c>, length=<%d>', &
50 & c1=trim(url), c2=trim(xtype), i=(/length/))
54 call urlsplit(url, file=filename, var=varname)
55 call gdncfileopen(ent%fileid, filename, stat=stat, writable=.true., &
56 & overwrite=overwrite)
57 if (stat /= nf90_noerr)
goto 999
59 if (stat /= nf90_noerr)
goto 999
63 if (
strieq(xtype,
"double") .or.
strieq(xtype,
"DOUBLEPRECISION"))
then 64 nc_xtype = nf90_double
66 if (
strieq(xtype,
"int") .or.
strieq(xtype,
"INTEGER"))
then 69 if (
strieq(xtype,
"char") .or.
strieq(xtype,
"CHARACTER"))
then 74 stat = nf90_def_dim(ent%fileid, trim(varname), len=length, dimid=ent%dimid)
75 if (stat /= nf90_noerr)
goto 999
76 stat = nf90_def_var(ent%fileid, trim(varname), &
77 & xtype=nc_xtype, dimids=(/ent%dimid/), varid=ent%varid)
78 if (stat /= nf90_noerr)
goto 999
81 if (stat /= nf90_noerr)
goto 999
84 call storeerror(stat, subname, err, cause_c=cause_c)
86 call endsub(subname,
'stat=%d', i=(/stat/))
integer function gdncfiledefinemode(fileid)
integer, parameter, public gt_enomem
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer function, public vtable_add(var, entry)
subroutine, public dbgmessage(fmt, i, r, d, L, n, c1, c2, c3, ca)
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
subroutine gdncfileopen(fileid, filename, writable, overwrite, stat, err)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ