Skip to content

Commit

Permalink
Fix to find "inputparser.py" anywhere in "live" folder
Browse files Browse the repository at this point in the history
  • Loading branch information
hersfeldtn committed May 17, 2023
1 parent be34bc1 commit f0cfea2
Showing 1 changed file with 181 additions and 16 deletions.
197 changes: 181 additions & 16 deletions gospl/upload/erosion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,44 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "5d4faae6",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/live/lib/test/inputparser.py\n"
]
},
{
"data": {
"text/plain": [
"'/usr/local/lib/python3.7/dist-packages/gospl/tools/inputparser.py'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import shutil\n",
"import os\n",
"for dirpath, dirname, files in os.walk(\"/live\"):\n",
" if \"inputparser.py\" in files:\n",
" infile = os.path.join(dirpath,\"inputparser.py\")\n",
" break\n",
"print(infile)\n",
"shutil.copyfile(\n",
" \"/live/lib/test/inputparser.py\",\n",
" infile,\n",
" \"/usr/local/lib/python3.7/dist-packages/gospl/tools/inputparser.py\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "3189a49a",
"metadata": {},
"outputs": [],
Expand All @@ -48,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "86ee6691",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -89,7 +113,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "b573efa5",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -494,7 +518,7 @@
"outputs": [],
"source": [
"#Displays mesh data on an interactable globe\n",
"#If you don't see one, make sure the script is \"Trusted\" in the upper right and allow the page to reload\n",
"#If you don't see one, make sure the script is \"Trusted\" in the upper right and/or reload the page \n",
"npzelev = os.path.join(input_path, str(st_time) + \"Ma\")\n",
"paleovtk = npzelev + \".vtk\"\n",
"\n",
Expand Down Expand Up @@ -539,12 +563,117 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "eb73c4ed",
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"--- Initialisation Phase (44.19 seconds)\n",
"+++ Output Simulation Time: 0.00 years\n",
"--- Computational Step (164.96 seconds)\n",
"--- Computational Step (162.41 seconds)\n",
"--- Computational Step (165.75 seconds)\n",
"--- Computational Step (164.86 seconds)\n",
"--- Computational Step (153.76 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 1266059562492.4067\n",
"--- Computational Step (148.99 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 1276366361310.602\n",
"--- Computational Step (149.18 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 1303986308734.421\n",
"--- Computational Step (156.82 seconds)\n",
"--- Computational Step (156.19 seconds)\n",
"--- Computational Step (156.49 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 1126150569874.6802\n",
"+++ Output Simulation Time: 100000.00 years\n",
"--- Computational Step (145.09 seconds)\n",
"--- Computational Step (152.27 seconds)\n",
"--- Computational Step (162.66 seconds)\n",
"--- Computational Step (166.13 seconds)\n",
"--- Computational Step (153.28 seconds)\n",
"--- Computational Step (157.65 seconds)\n",
"--- Computational Step (158.65 seconds)\n",
"--- Computational Step (156.85 seconds)\n",
"--- Computational Step (152.48 seconds)\n",
"--- Computational Step (154.54 seconds)\n",
"+++ Output Simulation Time: 200000.00 years\n",
"--- Computational Step (153.16 seconds)\n",
"--- Computational Step (154.37 seconds)\n",
"--- Computational Step (154.36 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_DTOL\n",
"input vector: 0.0 180569488.45258442\n",
"--- Computational Step (156.25 seconds)\n",
"--- Computational Step (163.40 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 3159132383008.698\n",
"--- Computational Step (156.07 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 1519566471590.905\n",
"--- Computational Step (151.60 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 2699843573903.7495\n",
"--- Computational Step (154.31 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_PCSETUP_FAILED\n",
"input vector: 0.0 2726775175700.499\n",
"--- Computational Step (155.99 seconds)\n",
"--- Computational Step (157.74 seconds)\n",
"+++ Output Simulation Time: 300000.00 years\n",
"--- Computational Step (154.65 seconds)\n",
"--- Computational Step (153.85 seconds)\n",
"--- Computational Step (149.72 seconds)\n",
"--- Computational Step (150.30 seconds)\n",
"--- Computational Step (153.10 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_DTOL\n",
"input vector: 0.0 324910304.8755483\n",
"--- Computational Step (149.02 seconds)\n",
"--- Computational Step (161.02 seconds)\n",
"--- Computational Step (162.92 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_DTOL\n",
"input vector: 0.0 196900747.20752218\n",
"--- Computational Step (151.41 seconds)\n",
"--- Computational Step (150.36 seconds)\n",
"+++ Output Simulation Time: 400000.00 years\n",
"--- Computational Step (155.64 seconds)\n",
"--- Computational Step (148.93 seconds)\n",
"LinearSolver failed to converge after %d iterations 0\n",
"with reason: %s DIVERGED_DTOL\n",
"input vector: 0.0 132082163.13789982\n",
"--- Computational Step (150.74 seconds)\n",
"--- Computational Step (157.16 seconds)\n",
"--- Computational Step (150.31 seconds)\n",
"--- Computational Step (148.67 seconds)\n",
"--- Computational Step (153.04 seconds)\n",
"--- Computational Step (149.82 seconds)\n",
"--- Computational Step (147.59 seconds)\n",
"--- Computational Step (148.81 seconds)\n",
"+++ Output Simulation Time: 500000.00 years\n",
"--- Computational Step (149.73 seconds)\n",
"\n",
"+++\n",
"+++ Total run time (7937.31 seconds)\n",
"+++\n"
]
}
],
"source": [
"# Runs model; can take hours but it'll report its progress as it runs\n",
"\n",
Expand All @@ -557,14 +686,50 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "758016e1",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Writing VTK file step5.vtk\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "08289fd6e3ff45a49d8032e12e2c589d",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Viewer(geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_points', 'numberO…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "08289fd6e3ff45a49d8032e12e2c589d",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Viewer(geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_points', 'numberO…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#Displays output on interactable globe\n",
"\n",
"stp = 3\n",
"stp = 5\n",
"uplift_forcing = False\n",
"\n",
"# Reading the final output generated by gospl\n",
Expand Down Expand Up @@ -592,15 +757,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "d07af917",
"metadata": {},
"outputs": [],
"source": [
"#Saves output to netcdf file\n",
"import mapOutputs as mout\n",
"\n",
"stp = 3\n",
"stp = 5\n",
"reso = 0.06\n",
"\n",
"grid = mout.mapOutputs(path='./', filename='input.yml',step=stp, uplift=False)\n",
Expand All @@ -611,15 +776,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "369a1839",
"metadata": {},
"outputs": [],
"source": [
"#Trimmed Version; saves only elevation, in 4 quadrants\n",
"import mapOutputs as mout\n",
"\n",
"stp = 3\n",
"stp = 5\n",
"reso = 0.02\n",
"\n",
"grid = mout.mapOutputs(path='./', filename='input.yml',step=stp, uplift=False)\n",
Expand Down

0 comments on commit f0cfea2

Please sign in to comment.