anvartostring.f90

Path: anvartostring.f90
Last Update: Wed Jul 20 18:22:22 JST 2005

Required files

Methods

Included Modules

dc_types dc_string an_vartable an_types

Public Instance methods

Function :
result :character(string)
var :type(AN_VARIABLE), intent(in)

[Source]

function ANVarToString(var) result(result)
    use dc_types, only: STRING
    use dc_string, only: cprintf
    use an_vartable, only: an_variable_entry, vtable_lookup
    use an_types, only: AN_VARIABLE
    implicit none
    character(string):: result
    type(AN_VARIABLE), intent(in):: var
    type(an_variable_entry):: ent
    if (vtable_lookup(var, ent) /= 0) then
        result = cprintf("AN_VARIABLE(bad id %d)", i=(/var%id/))
    else
        result = cprintf("AN_VARIABLE(file=%d, var=%d, dim=%d)", i=(/ent%fileid, ent%varid, ent%dimid/))
    endif
end function

[Validate]