Changeset 2309 for palm/trunk/SCRIPTS/palm_gf
- Timestamp:
- Jul 10, 2017 3:55:55 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_gf
r2308 r2309 422 422 c.execute("DROP TABLE IF EXISTS grid_limits") 423 423 c.execute( 424 "CREATE TABLE IF NOT EXISTS grid_current(nx INT, ny INT, nz INT, npex INT, npey INT, npxnpy FLOAT, np INT, ngpts INT )")424 "CREATE TABLE IF NOT EXISTS grid_current(nx INT, ny INT, nz INT, npex INT, npey INT, npxnpy FLOAT, np INT, ngpts INT, nxnpex FLOAT, nynpey FLOAT)") 425 425 c.execute( 426 "CREATE TABLE IF NOT EXISTS grid_limits(nx INT, ny INT, nz INT, npex INT, npey INT, npxnpy FLOAT, np INT, ngpts INT )")426 "CREATE TABLE IF NOT EXISTS grid_limits(nx INT, ny INT, nz INT, npex INT, npey INT, npxnpy FLOAT, np INT, ngpts INT, nxnpex FLOAT, nynpey FLOAT)") 427 427 conn.commit() 428 428 main_bool = True … … 591 591 592 592 npxnpy = format(float(npex) / float(npey), '.2f') 593 nxpex = float(nx+1) /float(npex) 594 nypey = float(ny+1) /float(npey) 595 593 596 c.execute( 594 """INSERT OR REPLACE INTO grid_current(nx, ny, nz, npex, npey, npxnpy, np, ngpts ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",595 (nx, ny, nz, npex, npey, npxnpy, (npex * npey), (nx * ny * nz) ))597 """INSERT OR REPLACE INTO grid_current(nx, ny, nz, npex, npey, npxnpy, np, ngpts, nxnpex, nynpey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", 598 (nx, ny, nz, npex, npey, npxnpy, (npex * npey), (nx * ny * nz), nxpex, nypey)) 596 599 597 600 nz += 1 … … 669 672 mn_ngpts = c.fetchone()[0] 670 673 # print(mn_ngpts) 674 c.execute("SELECT nxnpex FROM grid_current ORDER BY nxnpex DESC LIMIT 1") 675 mx_nxpex = c.fetchone()[0] 676 c.execute("SELECT nxnpex FROM grid_current ORDER BY nxnpex LIMIT 1") 677 mn_nxpex = c.fetchone()[0] 678 c.execute("SELECT nynpey FROM grid_current ORDER BY nynpey DESC LIMIT 1") 679 mx_nypey = c.fetchone()[0] 680 c.execute("SELECT nynpey FROM grid_current ORDER BY nynpey LIMIT 1") 681 mn_nypey = c.fetchone()[0] 682 683 671 684 672 685 conn.commit() 673 686 c.execute( 674 """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey, npxnpy, np, ngpts ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",675 (mn_nx, mn_ny, mn_nz, mn_npex, mn_npey, mn_npxnpy, mn_np, mn_ngpts ))687 """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey, npxnpy, np, ngpts, nxnpex, nynpey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", 688 (mn_nx, mn_ny, mn_nz, mn_npex, mn_npey, mn_npxnpy, mn_np, mn_ngpts, mn_nxpex, mn_nypey)) 676 689 677 690 c.execute( 678 """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey, npxnpy, np, ngpts ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",679 (mx_nx, mx_ny, mx_nz, mx_npex, mx_npey, mx_npxnpy, mx_np, mx_ngpts ))691 """INSERT OR REPLACE INTO grid_limits(nx, ny, nz, npex, npey, npxnpy, np, ngpts, nxnpex, nynpey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", 692 (mx_nx, mx_ny, mx_nz, mx_npex, mx_npey, mx_npxnpy, mx_np, mx_ngpts, mx_nxpex, mx_nypey)) 680 693 conn.commit() 681 694
Note: See TracChangeset
for help on using the changeset viewer.