#NEWLINE# def readStateFile( filename ) : #NEWLINE# #INDENT# 'Reads VIC initial state file.' #NEWLINE# state = OrderedDict ( ) #NEWLINE# with open ( filename ) as fin : #NEWLINE# #INDENT# dateline = fin . readline ( ) #NEWLINE# ( nlayer , nnodes ) = map ( int , fin . readline ( ) . split ( ) ) #NEWLINE# lines = fin . readlines ( ) #NEWLINE# c = 0 #NEWLINE# while ( c < len ( lines ) ) : #NEWLINE# #INDENT# cell = lines [ c ] . split ( ) #NEWLINE# ( cellid , nveg , nbands ) = map ( int , cell [ : 3 ] ) #NEWLINE# state [ cellid ] = lines [ c : ( ( c + ( ( nveg + 1 ) * nbands ) ) + 1 ) ] #NEWLINE# c = ( ( c + ( ( nveg + 1 ) * nbands ) ) + 1 ) #NEWLINE# #UNINDENT# #UNINDENT# return ( state , filename , nnodes , dateline )