Ignore:
Timestamp:
Jul 10, 2017 3:55:55 PM (4 years ago)
Author:
gronemeier
Message:

some further bugfixes for palm_gf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_gf

    r2308 r2309  
    422422        c.execute("DROP TABLE IF EXISTS grid_limits")
    423423        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)")
    425425        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)")
    427427        conn.commit()
    428428        main_bool = True
     
    591591
    592592                                npxnpy = format(float(npex) / float(npey), '.2f')
     593                                nxpex = float(nx+1) /float(npex)
     594                                nypey = float(ny+1) /float(npey)
     595
    593596                                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))
    596599
    597600                                nz += 1
     
    669672            mn_ngpts = c.fetchone()[0]
    670673            # 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
    671684
    672685            conn.commit()
    673686            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))
    676689
    677690            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))
    680693            conn.commit()
    681694
Note: See TracChangeset for help on using the changeset viewer.