Skip to content

Warning Message while processing RCHRES 'extrapolation of rchtab will take place' vanishes when repeating the run. #15

@AtrCheema

Description

@AtrCheema

I am running a for loop to on HSP2.run method, problem is, it shows warning message

2018-04-03 18:44:14.34 Message count 2 Message HYDR: extrapolation of rchtab will take place
2018-04-03 18:44:14.34 Message count 1 Message HYDR: Solve did not converge

But when I rerun the same file again, these messages are vanished. What more worse is that sometimes the warning message is vanished on third run and not even on second run. I am using following code to run the HDF5 file.

`

def ROR8D(hdfname):      # getting calculated RO from HDF
    bf_p1 = pd.read_hdf(hdfname, 'RESULTS/RCHRES_R009/HYDR')['RO']
    outflow = bf_p1#*0.028316847     # convert cfs to cms
    OutflowR8D = outflow.resample('D').mean()
    #print('now total outflow is {}'.format(sum(OutflowR8D)))
    if isinf(sum(OutflowR8D)):         # check if any value of calculated RO is infinity, 
        print(sum(OutflowR8D[1:]))
        print('infinity aa gya hai')
        #sys.exit()
        OutflowR8D = OutflowR8D.replace([np.inf, -np.inf], 0.0)  # replacing infinity values with 0.0
        print(sum(OutflowR8D))
    return OutflowR8D

def ObjectiveFunction(xx):    #xx is a list of input parameters

    #changing parameters 
    df2 = pd.read_hdf(hdfname, '/PERLND/PWATER/PARAMETERS') 
    print('sum of all input parameters is {0:10.7f}'.format(sum(xx)))    
    df2.LZSN   = xx[0]
    df2.INFILT = xx[1]
    df2.KVARY  = xx[2]
    df2.AGWRC  = xx[3]
    df2.DEEPFR = xx[4]
    df2.BASETP = xx[5]
    df2.AGWETP = xx[6]
    df2.CEPSC  = xx[7]
    df2.UZSN   = xx[8]
    df2.INTFW  = xx[9]
    df2.IRC    = xx[10]
    df2.LZETP  = xx[11]
    df2.NSUR   = xx[12]


    df2.to_hdf(hdfname, '/PERLND/PWATER/PARAMETERS')    

    HSP2.run(hdfname, saveall=True)

    OutflowR8D = ROR8D(hdfname)
    TotalFlow = sum(OutflowR8D)
    #print('\n total flow is {} '.format(TotalFlow))

    while isnan(TotalFlow):                     # rerunning if run gave errors in first run
        print('             ...........Rerunning............. ')
        HSP2.run(hdfname, saveall=True)

        OutflowR8D = ROR8D(hdfname)
        TotalFlow = sum(OutflowR8D)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions