Path: | gtdata/gtdata_netcdf/gdncvarputnum.f90 |
Last Update: | Mon May 25 18:51:59 +0900 2009 |
Authors: | Yasuhiro MORIKAWA, Eizi TOYODA |
Version: | $Id: gdncvarputnum.f90,v 1.2 2009-05-25 09:51:59 morikawa Exp $ |
Tag Name: | $Name: gtool5-20090809 $ |
Copyright: | Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved. |
License: | See COPYRIGHT |
Subroutine : | |
var : | type(GD_NC_VARIABLE), intent(in) |
start(:) : | integer, intent(in) |
count(:) : | integer, intent(in) |
stride(:) : | integer, intent(in) |
imap(:) : | integer, intent(in) |
siz : | integer, intent(in) |
value(siz) : | real(DP), intent(in) |
iostat : | integer, intent(out) |
subroutine GDNcVarPutDouble(var, start, count, stride, imap, siz, value, iostat) use dc_types, only: DP use gtdata_netcdf_types, only: GD_NC_VARIABLE use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY, vtable_lookup use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Double use gtdata_netcdf_file_generic, only: GDNcFileDataMode use dc_trace, only: BeginSub, EndSub, DbgMessage implicit none type(GD_NC_VARIABLE), intent(in):: var integer, intent(in):: start(:) integer, intent(in):: count(:) integer, intent(in):: stride(:) integer, intent(in):: imap(:) integer, intent(in):: siz real(DP), intent(in):: value(siz) integer, intent(out):: iostat integer:: ndims type(GD_NC_VARIABLE_ENTRY):: ent character(len = *), parameter:: subname = "GDNcVarPutDouble" continue call BeginSub(subname) iostat = vtable_lookup(var, ent) if (iostat /= nf_noerr) goto 999 ndims = 0 if (associated(ent%dimids)) ndims = size(ent%dimids) if (min(size(start), size(count), size(stride), size(imap)) < ndims) then iostat = nf_einval goto 999 endif call DbgMessage("f=%d v=%d sta=%*d c=%*d str=%*d imap=%*d", i=(/ent%fileid, ent%varid, start, count, stride, imap/), n=(/ndims, ndims, ndims, ndims/)) iostat = GDNcFileDataMode(ent%fileid) if (iostat /= nf_noerr) return iostat = nf_put_varm_Double(ent%fileid, ent%varid, start, count, stride, imap, value) 999 continue call EndSub(subname, "iostat=%d", i=(/iostat/)) end subroutine GDNcVarPutDouble
Subroutine : | |
var : | type(GD_NC_VARIABLE), intent(in) |
start(:) : | integer, intent(in) |
count(:) : | integer, intent(in) |
stride(:) : | integer, intent(in) |
imap(:) : | integer, intent(in) |
siz : | integer, intent(in) |
value(siz) : | integer, intent(in) |
iostat : | integer, intent(out) |
subroutine GDNcVarPutInt(var, start, count, stride, imap, siz, value, iostat) use dc_types, only: DP use gtdata_netcdf_types, only: GD_NC_VARIABLE use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY, vtable_lookup use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Int use gtdata_netcdf_file_generic, only: GDNcFileDataMode use dc_trace, only: BeginSub, EndSub, DbgMessage implicit none type(GD_NC_VARIABLE), intent(in):: var integer, intent(in):: start(:) integer, intent(in):: count(:) integer, intent(in):: stride(:) integer, intent(in):: imap(:) integer, intent(in):: siz integer, intent(in):: value(siz) integer, intent(out):: iostat integer:: ndims type(GD_NC_VARIABLE_ENTRY):: ent character(len = *), parameter:: subname = "GDNcVarPutInt" continue call BeginSub(subname) iostat = vtable_lookup(var, ent) if (iostat /= nf_noerr) goto 999 ndims = 0 if (associated(ent%dimids)) ndims = size(ent%dimids) if (min(size(start), size(count), size(stride), size(imap)) < ndims) then iostat = nf_einval goto 999 endif call DbgMessage("f=%d v=%d sta=%*d c=%*d str=%*d imap=%*d", i=(/ent%fileid, ent%varid, start, count, stride, imap/), n=(/ndims, ndims, ndims, ndims/)) iostat = GDNcFileDataMode(ent%fileid) if (iostat /= nf_noerr) return iostat = nf_put_varm_Int(ent%fileid, ent%varid, start, count, stride, imap, value) 999 continue call EndSub(subname, "iostat=%d", i=(/iostat/)) end subroutine GDNcVarPutInt
Subroutine : | |
var : | type(GD_NC_VARIABLE), intent(in) |
start(:) : | integer, intent(in) |
count(:) : | integer, intent(in) |
stride(:) : | integer, intent(in) |
imap(:) : | integer, intent(in) |
siz : | integer, intent(in) |
value(siz) : | real, intent(in) |
iostat : | integer, intent(out) |
subroutine GDNcVarPutReal(var, start, count, stride, imap, siz, value, iostat) use dc_types, only: DP use gtdata_netcdf_types, only: GD_NC_VARIABLE use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY, vtable_lookup use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Real use gtdata_netcdf_file_generic, only: GDNcFileDataMode use dc_trace, only: BeginSub, EndSub, DbgMessage implicit none type(GD_NC_VARIABLE), intent(in):: var integer, intent(in):: start(:) integer, intent(in):: count(:) integer, intent(in):: stride(:) integer, intent(in):: imap(:) integer, intent(in):: siz real, intent(in):: value(siz) integer, intent(out):: iostat integer:: ndims type(GD_NC_VARIABLE_ENTRY):: ent character(len = *), parameter:: subname = "GDNcVarPutReal" continue call BeginSub(subname) iostat = vtable_lookup(var, ent) if (iostat /= nf_noerr) goto 999 ndims = 0 if (associated(ent%dimids)) ndims = size(ent%dimids) if (min(size(start), size(count), size(stride), size(imap)) < ndims) then iostat = nf_einval goto 999 endif call DbgMessage("f=%d v=%d sta=%*d c=%*d str=%*d imap=%*d", i=(/ent%fileid, ent%varid, start, count, stride, imap/), n=(/ndims, ndims, ndims, ndims/)) iostat = GDNcFileDataMode(ent%fileid) if (iostat /= nf_noerr) return iostat = nf_put_varm_Real(ent%fileid, ent%varid, start, count, stride, imap, value) 999 continue call EndSub(subname, "iostat=%d", i=(/iostat/)) end subroutine GDNcVarPutReal