Changeset 2349 in lmdz_wrf
- Timestamp:
- Feb 18, 2019, 8:30:27 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r2348 r2349 28661 28661 dn, vu) 28662 28662 anewvar.setncattr('coordinates',' '.join(Spgrid[::-1])) 28663 anewvar[:] = areas[0:Ngridsinmax,...]28664 28663 28665 28664 aanewvar = onewnc.createVariable(dn+'area','f',tuple(Srgrid), \ … … 28700 28699 gridsin[:,0:Ngridsin[j,i],j,i] 28701 28700 pnewvar[0:Ngridsin[j,i],j,i]= percens[0:Ngridsin[j,i],j,i] 28701 anewvar[0:Ngridsin[j,i],j,i]= areas[0:Ngridsin[j,i],j,i] 28702 28702 slicearea = 0. 28703 28703 aa = 0. … … 28706 28706 ix = gridsin[1,iv,j,i] 28707 28707 iy = gridsin[0,iv,j,i] 28708 apolygon[:,0] = xdimvarbnds2D[:,iy,ix] 28709 apolygon[:,1] = ydimvarbnds2D[:,iy,ix] 28710 ag = np.abs(fsci.module_scientific.shoelace_area_polygon(nvertex=4, poly=apolygon)) 28711 slicearea = slicearea + ag*percens[iv,j,i] 28708 # apolygon[:,0] = xdimvarbnds2D[:,iy,ix] 28709 # apolygon[:,1] = ydimvarbnds2D[:,iy,ix] 28710 # ag = np.abs(fsci.module_scientific.shoelace_area_polygon(nvertex=4, poly=apolygon)) 28711 # Filtering zero areas? 28712 if areas[iv,j,i] == 0.: 28713 anewvar[iv,j,i] = 0. 28714 pnewvar[iv,j,i] = 0. 28715 areas[iv,j,i] = 0. 28716 percens[iv,j,i] = 0. 28717 28718 slicearea = slicearea + areas[iv,j,i]*percens[iv,j,i] 28712 28719 aa = aa + areas[iv,j,i] 28713 28720 pp = pp + percens[iv,j,i] … … 28738 28745 Nnewslcs = len(newslcvarns) 28739 28746 28740 dn = newslcvarns[0] + ' _' + newslcvarns[1]28747 dn = newslcvarns[0] + '-' + newslcvarns[1] 28741 28748 28742 28749 osliceNA = onewnc.variables[newslcvarns[0] + 'Ngrid'] … … 28884 28891 islc == 2 28885 28892 prevdn = dn 28886 dn = prevdn + ' _' + newslcvarns[islc]28893 dn = prevdn + '-' + newslcvarns[islc] 28887 28894 28888 28895 osliceNAB = onewnc.variables[prevdn + 'Ngrid'] … … 29183 29190 idd = 0 29184 29191 for dnn in Ndims: 29185 scvv = slicesinf[dnn.split(' _')[1]]29192 scvv = slicesinf[dnn.split('-')[1]] 29186 29193 sccvvv = scvv[3] 29187 29194 slicesvals.append(sccvvv[chijk[idd]])
Note: See TracChangeset
for help on using the changeset viewer.