Skip to content

Commit

Permalink
small language corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainp committed Apr 29, 2022
1 parent c41f702 commit c1a802f
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"# install mfm if needed\n",
"# !pip install git+https://github.com/ghislainp/mfm --log tmp.log\n",
"\n",
"# other option is to point to mfm:\n",
"# the other option is to point to mfm:\n",
"import sys\n",
"sys.path.append(\"../..\")"
]
Expand Down Expand Up @@ -59,6 +59,8 @@
},
"outputs": [],
"source": [
"# set this parameter to choose the site\n",
"\n",
"location = \"salix\"\n",
"\n",
"#location = \"tundra\""
Expand All @@ -79,7 +81,7 @@
" met = pd.read_csv(\"data/Ttundra.csv\", parse_dates=True, index_col=0)\n",
" met += 273.15\n",
" \n",
" met = met.loc['2018-09-15':] # start the simulation 1 dec 2018\n",
" met = met.loc['2018-09-15':] # start the simulation 15 Sep 2018\n",
" \n",
" nlyr_snow = 38 # 38 cm\n",
"\n",
Expand All @@ -98,7 +100,7 @@
" ks_snow_spring = np.zeros(nlyr_snow)\n",
" ks_snow_melt = np.zeros(nlyr_snow)\n",
" \n",
" # density. Each layer is 1cm. 0 is the ground, 38 is the top\n",
" # density. Each layer is 1 cm thick. 0 is the ground, 38 is the top\n",
" rho_snow[0:10] = 220\n",
" rho_snow[10:20] = 325\n",
" rho_snow[20:38] = 350\n",
Expand All @@ -124,7 +126,7 @@
" met = pd.read_csv(\"data/Tsalix.csv\", parse_dates=True, index_col=0)\n",
" met += 273.15\n",
"\n",
" met = met.loc['2018-09-15':] # start the simulation 1 dec 2018\n",
" met = met.loc['2018-09-15':] # start the simulation 15 Sep 2018\n",
" \n",
" nlyr_snow = 40 # 40 cm\n",
"\n",
Expand All @@ -144,7 +146,7 @@
" ks_snow_spring = np.zeros(nlyr_snow)\n",
" ks_snow_melt = np.zeros(nlyr_snow)\n",
" \n",
" # density. Each layer is 1cm. 0 is the ground, 38 is the top\n",
" # density. Each layer is 1cm thick. 0 is the ground, 38 is the top\n",
" rho_snow[0:10] = 210\n",
" rho_snow[10:20] = 240\n",
" rho_snow[20:40] = 330\n",
Expand Down Expand Up @@ -192,7 +194,6 @@
"\n",
"soil_layers = 2\n",
"\n",
"\n",
"# 2 LAYER SOIL\n",
"if soil_layers == 2:\n",
" # summer (unfrozen) soil\n",
Expand Down Expand Up @@ -297,7 +298,7 @@
"\n",
"# initial temperature profile\n",
"#\n",
"# Ajuster ici z0 et temp0 pour decrire le profil de temperature initial\n",
"# Here, ajust the z0 and temp0 parameters to prescribe a realistic initial profile of temperature\n",
"#\n",
"z0 = [30, 5, 0, -5, -10, -30, -100, -200, -500] # depths in centimeter (positive = snow, negative = soil, 0 = interface soil/snow)\n",
"temp0 = [0, 0, 0, 0, 0, 0, -4, -7,-11] # temperature at each depth\n",
Expand Down Expand Up @@ -359,10 +360,9 @@
" temp[0:itop] = temp[itop] # copy the surface temperature up\n",
" itop = nlyr_snow - int(np.round(height_timeseries_copy.pop(0)[1]))\n",
" if itop < 0:\n",
" print(\"Erreur, la hauteur dans height_date est trop elevée par rapport à nlyr_snow\")\n",
" print(\"Error: the height in 'height_date' is too large compared to 'nlyr_snow'\")\n",
"\n",
" for j in range(0, 3600, params.dt): # sub-hourly loop\n",
" #temp = model_dirichlet(ts, temp, params)\n",
" otemp = np.full_like(temp, np.nan)\n",
" otemp[itop:] = cranknicolson_dirichlet(temp[itop:], ts, params.dt, params.dx[itop:], params.ks[itop:],\n",
" params.rho[itop:], cpice=params.cp[itop:], tbase=params.tbase) # run the model for 1 timestep\n",
Expand Down Expand Up @@ -440,8 +440,8 @@
"\n",
" df = pd.DataFrame(np.transpose(out), columns=moddepths, index=o_time)\n",
"\n",
" #df.to_excel(f'results-{location}.xls')\n",
" df.to_csv(f'results-{location}.csv')\n",
" #df.to_excel(f'results-{location}.xls') # save as an excel file\n",
" df.to_csv(f'results-{location}.csv') # save as a csv file\n",
"\n",
"plot()"
]
Expand Down

0 comments on commit c1a802f

Please sign in to comment.