diff --git a/README.md b/README.md index 1590e28..bf1d373 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ *If you wish to use WRF4PALM v1.0, please go to [WRF4PALM v1.0](https://github.com/dongqi-DQ/WRF4PALM/tree/v1.0)* +**Want to create your own static driver? Check out [GEO4PALM](https://github.com/dongqi-DQ/GEO4PALM)!** + ## Contents 1. [What's new?](https://github.com/dongqi-DQ/WRF4PALM/tree/v1.1/#whats-new-in-v11) 2. [Instructions](https://github.com/dongqi-DQ/WRF4PALM/tree/v1.1/#instrustions) diff --git a/run_config_wrf4palm.py b/run_config_wrf4palm.py index 48a4285..bf6ae20 100755 --- a/run_config_wrf4palm.py +++ b/run_config_wrf4palm.py @@ -345,13 +345,18 @@ smois_wrf.isel(soil_layers=izs).data[watermask] = median_smois[izs] if smois_wrf.isel(soil_layers=izs).mean()== 0.0: smois_wrf.isel(soil_layers=izs).data[:,:] = msoil_val - +# convert soil thickness to depth +zs_palm = np.zeros_like(dz_soil) +zs_palm[0] = dz_soil[0] +for i in range(1,len(dz_soil)): + zs_palm[i] = np.sum(dz_soil[:i+1]) + init_tsoil = np.zeros((len(dz_soil), len(y), len(x))) init_msoil = np.zeros((len(dz_soil), len(y), len(x))) for iy in tqdm(range(0,len(y)),position=0, leave=True): for ix in range(0, len(x)): - init_tsoil[:,iy,ix] = np.interp(dz_soil, zs_wrf.data, tslb_wrf[:,iy,ix]) - init_msoil[:,iy,ix] = np.interp(dz_soil, zs_wrf.data, smois_wrf[:,iy,ix]) + init_tsoil[:,iy,ix] = np.interp(zs_palm, zs_wrf.data, tslb_wrf[:,iy,ix]) + init_msoil[:,iy,ix] = np.interp(zs_palm, zs_wrf.data, smois_wrf[:,iy,ix]) #------------------------------------------------------------------------------- # Vertical interpolation