- Timestamp:
- May 28, 2019, 7:31:54 PM (6 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/module_scientific.f90
r2561 r2562 7360 7360 7361 7361 ! Local 7362 INTEGER :: ixA, iyA, ixB, iyB, iv, iv1, iv2 7362 INTEGER :: ixA, iyA, ixB, iyB, iv, iv1, iv2, iiv 7363 7363 INTEGER :: NA, NB 7364 7364 INTEGER, DIMENSION(dxyA) :: ptsA, ptsB 7365 7365 INTEGER, DIMENSION(dxyA, 2) :: pts 7366 LOGICAL :: found 7366 7367 7367 7368 … … 7396 7397 IF ( (pointsA(ixA,iyA,iv1,1) == pointsB(ixB,iyB,iv2,1)) .AND. & 7397 7398 (pointsA(ixA,iyA,iv1,2) == pointsB(ixB,iyB,iv2,2)) ) THEN 7399 ! need to avoid double count (in ix[X] == 1) 7400 found = .FALSE. 7401 DO iiv = 1, iv 7402 IF ( (pointsA(ixA,iyA,iv1,1) == points(ixA,iyB,ixB,iyB,iiv,1)) .AND. & 7403 (pointsA(ixA,iyA,iv1,2) == points(ixA,iyB,ixB,iyB,iiv,2)) ) THEN 7404 found = .TRUE. 7405 END IF 7406 END DO 7407 IF (found) CYCLE 7398 7408 iv = iv + 1 7399 7409 points(ixA,iyA,ixB,iyB,iv,1) = pointsA(ixA,iyA,iv1,1) -
trunk/tools/nc_var_tools.py
r2561 r2562 29212 29212 reflat1D = varslcv[3] 29213 29213 refblat1D = varslcv[4] 29214 dref.append(varn) 29214 #dref.append(varn) 29215 Nv = gen.ntimesHval_inlist(list(onewnc.dimensions), dimvars[ydim]) 29216 varnS = dimvars[ydim] + str(Nv) 29217 dref.append(varnS) 29218 # dref.append(dimvars[ydim]) 29215 29219 else: 29216 29220 print infmsg … … 29245 29249 reflon1D = varslcv[3] 29246 29250 refblon1D = varslcv[4] 29247 dref.append(varn) 29251 # dref.append(varn) 29252 Nv = gen.ntimesHval_inlist(list(onewnc.dimensions), dimvars[xdim]) 29253 varnS = dimvars[xdim] + str(Nv) 29254 dref.append(varnS) 29248 29255 else: 29249 29256 print infmsg … … 29633 29640 newdim = onewnc.createDimension('coord',2) 29634 29641 29635 print ' Lluis dims ', dn+'Ngrid', 'Srgrid', Srgrid29636 29637 29642 newvar = onewnc.createVariable(dn+'Ngrid','i', tuple(Srgrid)) 29638 29643 if Ngridsin.shape[1] == 1: … … 29764 29769 dxyB = osliceinB.shape[1] 29765 29770 29766 print 'Lluis dims osliceNB', osliceNB.dimensions, 'osliceNA', osliceNA.dimensions29767 29768 29769 29771 Srgrid = list(osliceNB.dimensions) + list(osliceNA.dimensions) 29770 29772 Sigrid = ['coord', dn+'gridin'] + Srgrid … … 29786 29788 #sliceinBt[...,1] = sliceinBt0[...,0]+1 29787 29789 29788 iiB = 329789 jjB = 029790 iiA = 029791 jjA = 329792 29790 NpointsABt, pointsABt, inpA, inpB = fsci.module_scientific.coincident_gridsin2d( \ 29793 29791 npointsa=sliceNAt, pointsa=sliceinAt, npointsb=sliceNBt, pointsb=sliceinBt, \ … … 29798 29796 inpointsB = inpB.transpose() 29799 29797 29800 print 'Lluis here 00'29801 29798 29802 29799 # Remembering that it is python (C-like...) … … 29815 29812 if not gen.searchInlist(onewnc.dimensions, dn+'gridin'): 29816 29813 newdim = onewnc.createDimension(dn+'gridin', maxNpointsAB) 29817 29818 print 'Lluis file creation'29819 29820 print 'Lluis shapes: newvar', newvar.shape, 'NpointsAB', NpointsAB.shape, 'Srgrid', Srgrid29821 29814 29822 29815 newvar = onewnc.createVariable(dn+'Ngrid','i', tuple(Srgrid)) … … 29826 29819 newvar.setncattr('coordinates',' '.join(Srgrid[::-1])) 29827 29820 29828 print 'Lluis file creation 1'29829 29830 29821 innewvar = onewnc.createVariable(dn+'gridin', 'i', tuple(Sigrid), \ 29831 29822 fill_value=gen.fillValueI) … … 29834 29825 innewvar.setncattr('coordinates',' '.join(Srgrid[::-1])) 29835 29826 29836 print 'Lluis file creation 2'29837 29838 29827 aanewvar = onewnc.createVariable(dn+'area','f',tuple(Srgrid), \ 29839 29828 fill_value=gen.fillValueF) … … 29842 29831 aanewvar.setncattr('coordinates',' '.join(Srgrid[::-1])) 29843 29832 29844 print 'Lluis file creation 3'29845 29846 29833 anewvar = onewnc.createVariable(dn+'gridarea','f',tuple(Spgrid), \ 29847 29834 fill_value=gen.fillValueF) … … 29850 29837 anewvar.setncattr('coordinates',' '.join(Spgrid[::-1])) 29851 29838 29852 print 'Lluis file creation 4'29853 29854 29839 pnewvar = onewnc.createVariable(dn+'gridpercen','f',tuple(Spgrid), \ 29855 29840 fill_value=gen.fillValueF) … … 29857 29842 "grids cells from " + newslcvarns[0] + " laying within " + newslcvarns[1], '1') 29858 29843 pnewvar.setncattr('coordinates',' '.join(Spgrid[::-1])) 29859 29860 print 'Lluis prior to... dyA, dxA, dyB, dxB', dyA, dxA, dyB, dxB29861 29844 29862 29845 for jA in range(dyA): … … 29896 29879 #onewnc.close() 29897 29880 #quit() 29898 29899 print 'Lluis here !!'29900 29881 29901 29882 if Nnewslcs >= 3:
Note: See TracChangeset
for help on using the changeset viewer.