Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial CM1 P3 results with fixed droplets and diagnostic ice #55

Merged
merged 13 commits into from
May 20, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkchandr Does this file contain adapted code to convert the DEPHY forcing to forcing for CM1? If so, please rename the file to something like 'convert_comble_dephy_forcing_to_CM1_LES_forcing.ipynb' so that we don't overwrite the original file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twjuliano It doesn't contain any modification for the CM1 forcing. I reverted this commit.

Large diffs are not rendered by default.

30 changes: 23 additions & 7 deletions notebooks/plotting/check_les.ipynb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkchandr Please remove this file from the commit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twjuliano I revert the commit.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 26,
"id": "8dc64df9-ac74-4def-bcb4-740c421e1f9a",
"metadata": {
"tags": []
Expand All @@ -29,12 +29,12 @@
"sim_keyword_gray = 'dharma/sandbox/DHARMA_Lx25_dx200_FixN.'\n",
"\n",
"## select LES run(s) of interest\n",
"sim_keyword_col_les = 'WRF_Lx25_dx100_FixN.'"
"sim_keyword_col_les = 'CM1_P3_Lx25_dx100_FixN.'"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 27,
"id": "e6ed1ee4-e2e4-4044-b256-010c272438bb",
"metadata": {
"tags": []
Expand All @@ -58,7 +58,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 28,
"id": "aebc954d-1bd0-459a-9ac5-0b8305f2652b",
"metadata": {
"tags": []
Expand All @@ -80,9 +80,25 @@
"dni_sip not found in ../../output_les/dharma/sandbox/DHARMA_Lx25_dx200_FixN.nc\n",
"dni_hom not found in ../../output_les/dharma/sandbox/DHARMA_Lx25_dx200_FixN.nc\n",
"Loading variables: f(time)\n",
"../../output_les/wrf/sandbox/WRF_Lx25_dx100_FixN.nc\n",
"../../output_les/cm1-p3/devel/CM1_P3_Lx25_dx100_FixN.nc\n",
"Loading variables: f(time,height)\n",
"../../output_les/wrf/sandbox/WRF_Lx25_dx100_FixN.nc\n"
"../../output_les/cm1-p3/devel/CM1_P3_Lx25_dx100_FixN.nc\n"
]
},
{
"ename": "ValueError",
"evalue": "Length of values (158) does not match length of index (600)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[28], line 5\u001b[0m\n\u001b[1;32m 2\u001b[0m df_gray_1d,df_gray_2d \u001b[38;5;241m=\u001b[39m load_sims(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m../../output_les/\u001b[39m\u001b[38;5;124m'\u001b[39m,var_vec_1d,var_vec_2d,t_shift\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m2\u001b[39m,keyword\u001b[38;5;241m=\u001b[39msim_keyword_gray,make_gray \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m## example using LES\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m df_col_1d_les,df_col_2d_les \u001b[38;5;241m=\u001b[39m \u001b[43mload_sims\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m../../output_les/\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mvar_vec_1d\u001b[49m\u001b[43m,\u001b[49m\u001b[43mvar_vec_2d\u001b[49m\u001b[43m,\u001b[49m\u001b[43mt_shift\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mkeyword\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msim_keyword_col_les\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/user-data-home/comble-mip/notebooks/plotting/functions_plotting.py:642\u001b[0m, in \u001b[0;36mload_sims\u001b[0;34m(path, var_vec_1d, var_vec_2d, t_shift, keyword, make_gray, drop_t0, diag_zi_ctt, QTHRES)\u001b[0m\n\u001b[1;32m 640\u001b[0m p_df2[vv] \u001b[38;5;241m=\u001b[39m ds\u001b[38;5;241m.\u001b[39mvariables[vv][t0:][ii]\n\u001b[1;32m 641\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 642\u001b[0m \u001b[43mp_df2\u001b[49m\u001b[43m[\u001b[49m\u001b[43mvv\u001b[49m\u001b[43m]\u001b[49m \u001b[38;5;241m=\u001b[39m ds\u001b[38;5;241m.\u001b[39mvariables[vv][t0:,:][:,ii]\n\u001b[1;32m 643\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 644\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m(ii\u001b[38;5;241m==\u001b[39m\u001b[38;5;241m0\u001b[39m): \u001b[38;5;28mprint\u001b[39m(vv \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m not found in \u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mstr\u001b[39m(fn))\n",
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/frame.py:3980\u001b[0m, in \u001b[0;36mDataFrame.__setitem__\u001b[0;34m(self, key, value)\u001b[0m\n\u001b[1;32m 3977\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_setitem_array([key], value)\n\u001b[1;32m 3978\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 3979\u001b[0m \u001b[38;5;66;03m# set column\u001b[39;00m\n\u001b[0;32m-> 3980\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_set_item\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/frame.py:4174\u001b[0m, in \u001b[0;36mDataFrame._set_item\u001b[0;34m(self, key, value)\u001b[0m\n\u001b[1;32m 4164\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_set_item\u001b[39m(\u001b[38;5;28mself\u001b[39m, key, value) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 4165\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 4166\u001b[0m \u001b[38;5;124;03m Add series to DataFrame in specified column.\u001b[39;00m\n\u001b[1;32m 4167\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 4172\u001b[0m \u001b[38;5;124;03m ensure homogeneity.\u001b[39;00m\n\u001b[1;32m 4173\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 4174\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sanitize_column\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4176\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 4177\u001b[0m key \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcolumns\n\u001b[1;32m 4178\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m value\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 4179\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m is_extension_array_dtype(value)\n\u001b[1;32m 4180\u001b[0m ):\n\u001b[1;32m 4181\u001b[0m \u001b[38;5;66;03m# broadcast across multiple columns if necessary\u001b[39;00m\n\u001b[1;32m 4182\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcolumns\u001b[38;5;241m.\u001b[39mis_unique \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcolumns, MultiIndex):\n",
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/frame.py:4915\u001b[0m, in \u001b[0;36mDataFrame._sanitize_column\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 4912\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _reindex_for_setitem(Series(value), \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mindex)\n\u001b[1;32m 4914\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_list_like(value):\n\u001b[0;32m-> 4915\u001b[0m \u001b[43mcom\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequire_length_match\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mindex\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4916\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m sanitize_array(value, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mindex, copy\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, allow_2d\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n",
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/common.py:571\u001b[0m, in \u001b[0;36mrequire_length_match\u001b[0;34m(data, index)\u001b[0m\n\u001b[1;32m 567\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 568\u001b[0m \u001b[38;5;124;03mCheck the length of data matches the length of the index.\u001b[39;00m\n\u001b[1;32m 569\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 570\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(data) \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(index):\n\u001b[0;32m--> 571\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 572\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLength of values \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 573\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m(\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mlen\u001b[39m(data)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m) \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 574\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdoes not match length of index \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 575\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m(\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mlen\u001b[39m(index)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 576\u001b[0m )\n",
"\u001b[0;31mValueError\u001b[0m: Length of values (158) does not match length of index (600)"
]
}
],
Expand All @@ -96,7 +112,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 29,
"id": "99b99c60-0955-4f66-b70e-46456c529210",
"metadata": {
"tags": []
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file name is the same as the one in the 'sandbox' folder. Can you confirm that this is a duplicate and then remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed these files.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading