Changeset 816 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jun 12, 2016, 2:22:14 PM (8 years ago)
Author:
lfita
Message:

Removing spurious commentaries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r813 r816  
    66386638        Njipt = dictionary_key(subfinished, False)
    66396639        if Njipt is not None:
    6640             print Njipt, 'points subflow:', ijsubflow[Njipt]
     6640#            print Njipt, 'points subflow:', ijsubflow[Njipt]
    66416641            for ipt in ijsubflow[Njipt]:
    66426642                if ijfound[ipt] == False:
    66436643                    jipt = ijsubbasin[ipt]
    66446644                    break
    6645             print '  working from point:', ipt, 'ji pair:', jipt
     6645#            print '  working from point:', ipt, 'ji pair:', jipt
    66466646            ijfound[ipt] = True
    66476647            Nij = ipt
     
    66496649# Keep searching since there are grid-points not found!
    66506650            print '  ' + fname + ': Keep searching since there are grid-points not found!!'
    6651             print ijfound
     6651#            print ijfound
    66526652            Nij = dictionary_key(ijfound, False)
    66536653            if Nij is None:
     
    66676667            else:
    66686668                Njipt = Njipt + '1'
    6669             print '  ' + fname + "new sub-flow '" + Njipt + "' !!"
     6669#            print '  ' + fname + "new sub-flow '" + Njipt + "' !!"
    66706670            subfinished[Njipt] = False
    66716671            Nij = np.max(ijfound.keys())
    66726672
    6673         print 'Lluis Nij:', Nij
     6673#        print 'Lluis Nij:', Nij
    66746674# Looking for which point of the sub-flow retake the search
    66756675        if Nij == 1:
     
    66786678
    66796679        ardtrips = vals_around(trips,jipt)
    6680         print '  ' + fname + 'ardtrips _______'
    6681         print ardtrips
     6680#        print '  ' + fname + 'ardtrips _______'
     6681#        print ardtrips
    66826682
    66836683        arrive = incomming_flow(ardtrips)
    66846684        Narrive = np.sum(arrive)
    6685         print Nij, '  ' + fname + ' Narrive:', Narrive
     6685#        print Nij, '  ' + fname + ' Narrive:', Narrive
    66866686        if Narrive == 0:
    66876687            ijfound[Nij] = True
    66886688            subfinished[Njipt] = True
    66896689        else:
    6690             print '  ' + fname + 'arrive _______'
    6691             print arrive
     6690#            print '  ' + fname + 'arrive _______'
     6691#            print arrive
    66926692            followvals = np.zeros((3,3), dtype=bool)
    66936693            followvals = arrive
    66946694
    66956695            for ifollow in range(Narrive):
    6696                 print 'ifollow:',ifollow,'/',Narrive
     6696#                print 'ifollow:',ifollow,'/',Narrive
    66976697
    66986698# We only want to work with that ij, which have not yet been found
    66996699                while np.sum(followvals) != 0:
    6700                     print Nij,'  Looking for a non-located point in subbasin ________'
    6701                     print subbasin[jipt[0]-1:jipt[0]+2,jipt[1]-1:jipt[1]+2]
     6700#                    print Nij,'  Looking for a non-located point in subbasin ________'
     6701#                    print subbasin[jipt[0]-1:jipt[0]+2,jipt[1]-1:jipt[1]+2]
    67026702                    jifollow = index_mat(followvals, True)
    67036703                    jiequiv = jifollow - [1,1]
     
    67116711                            else:
    67126712                                Njipt = Njipt + str(ifollow)
    6713                             print '  ' + fname + "new sub-flow '" + Njipt + "' !!"
     6713#                            print '  ' + fname + "new sub-flow '" + Njipt + "' !!"
    67146714                        subfinished[Njipt] = False
    67156715                        subbasin[jipt[0]+jiequiv[0], jipt[1]+jiequiv[1]] = True
     
    67286728                            ijfound[Nij] = True
    67296729                            subfinished[Njipt] = True
    6730                             print Nij,"  subflow '" + Njipt + "' finished!!"
     6730#                            print Nij,"  subflow '" + Njipt + "' finished!!"
    67316731                            break
    67326732
     
    67376737                    quit()
    67386738
    6739             if ijsubflow.has_key(Njipt):
    6740                 print "Lluis points of subflow: '" + Njipt + "' _______=", ijsubflow[Njipt]
    6741                 for isub in ijsubflow[Njipt]:
    6742                     print '  ' , isub , ':', ijsubbasin[isub], ijfound[isub]
    6743             if Nij == 10: print 'Nij = 9:', ijfound[9]
    6744 
    6745         print subbasin
     6739#            if ijsubflow.has_key(Njipt):
     6740#                print "Lluis points of subflow: '" + Njipt + "' _______=", ijsubflow[Njipt]
     6741#                for isub in ijsubflow[Njipt]:
     6742#                    print '  ' , isub , ':', ijsubbasin[isub], ijfound[isub]
     6743#            if Nij == 10: print 'Nij = 9:', ijfound[9]
     6744
     6745#        print subbasin
    67466746#        if Nij > 4: quit()
    67476747
    67486748    return subbasin
    67496749
    6750 # Caceres
    6751 rivers = np.array([7, 1, 1, 1, 1, 5, 5, 1, \
    6752   7, 1, 6, 3, 5, 5, 6, 5, \
    6753   8, 7, 5, 3, 5, 6, 3, 5, \
    6754   1, 1, 3, 5, 5, 7, 5, 5, \
    6755   3, 3, 5, 6, 5, 5, 5, 7 ], dtype=int).reshape(5,8)
    6756 
    6757 point = [4,4]
     6750## Caceres
     6751#rivers = np.array([7, 1, 1, 1, 1, 5, 5, 1, \
     6752#  7, 1, 6, 3, 5, 5, 6, 5, \
     6753#  8, 7, 5, 3, 5, 6, 3, 5, \
     6754#  1, 1, 3, 5, 5, 7, 5, 5, \
     6755#  3, 3, 5, 6, 5, 5, 5, 7 ], dtype=int).reshape(5,8)
     6756
     6757#point = [4,4]
    67586758
    67596759# Porto Do Alegre
     
    67706770#point = [7,0]
    67716771
    6772 print rivers
    6773 print rivers[point[0], point[1]]
    6774 
    6775 masksubbasin, subflows, subflowspt = subbasin_point(rivers, point)
    6776 print rivers
    6777 print masksubbasin
    6778 for subflow in subflows:
    6779   print subflow, ':', subflows[subflow]
    6780   for isub in subflows[subflow]:
    6781       print '  ' , isub , ':', subflowspt[isub]
    6782 
    6783 print 'Total sub-basin:', np.sum(masksubbasin)
    6784 
    6785 quit()
     6772#print rivers
     6773#print rivers[point[0], point[1]]
     6774
     6775#masksubbasin, subflows, subflowspt = subbasin_point(rivers, point)
     6776#print rivers
     6777#print masksubbasin
     6778#for subflow in subflows:
     6779#  print subflow, ':', subflows[subflow]
     6780#  for isub in subflows[subflow]:
     6781#      print '  ' , isub , ':', subflowspt[isub]
     6782
     6783#print 'Total sub-basin:', np.sum(masksubbasin)
     6784
     6785#quit()
Note: See TracChangeset for help on using the changeset viewer.