gdncvarsync.f90

Path: gtdata/gtdata_netcdf/gdncvarsync.f90
Last Update: Mon May 25 18:51:59 +0900 2009

Copyright (C) GFD Dennou Club, 2000. All rights reserved

Required files

Methods

Included Modules

gtdata_netcdf_types gtdata_netcdf_file_generic gtdata_netcdf_internal netcdf_f77

Public Instance methods

Subroutine :
var :type(GD_NC_VARIABLE), intent(in), optional
stat :integer, intent(out), optional

[Source]

subroutine GDNcVarSync(var, stat)
    use gtdata_netcdf_types, only: GD_NC_VARIABLE, GD_NC_VARIABLE_ENTRY
    use gtdata_netcdf_file_generic, only: GDNcFileSync
    use gtdata_netcdf_internal, only: vtable_lookup
    use netcdf_f77, only: nf_noerr
    implicit none
    type(GD_NC_VARIABLE), intent(in), optional:: var
    integer, intent(out), optional:: stat
    type(GD_NC_VARIABLE_ENTRY):: ent
    integer:: mystat
    if (.not. present(var)) then
        call GDNcFileSync(stat=stat)
        return
    endif
    mystat = vtable_lookup(var, ent)
    if (mystat /= NF_NOERR) then
        if (present(stat)) stat = mystat
    else
        call GDNcFileSync(ent%fileid, stat=stat)
    endif
end subroutine