Initial Soil Moisture State Sensitivity

Create a template run directory

In [1]:
%%bash
# Make a new directory for our baseline simulation
mkdir -p ~/wrf-hydro-training/output/free_lesson_states/run_template

# Copy our model files to the simulation directory
cp ~/wrf-hydro-training/wrf_hydro_nwm_public/trunk/NDHMS/Run/*.TBL \
~/wrf-hydro-training/output/free_lesson_states/run_template
cp ~/wrf-hydro-training/wrf_hydro_nwm_public/trunk/NDHMS/Run/wrf_hydro.exe \
~/wrf-hydro-training/output/free_lesson_states/run_template

# Create symbolic links to forcing files
cp -as $HOME/wrf-hydro-training/example_case/FORCING \
~/wrf-hydro-training/output/free_lesson_states/run_template

# Copy the domain/parameter files so we can modify them
cp -r $HOME/wrf-hydro-training/example_case/Gridded_no_lakes/DOMAIN \
~/wrf-hydro-training/output/free_lesson_states/run_template
cp -r $HOME/wrf-hydro-training/example_case/Gridded_no_lakes/RESTART \
~/wrf-hydro-training/output/free_lesson_states/run_template

# Copy namelist files
cp ~/wrf-hydro-training/example_case/Gridded_no_lakes/namelist.hrldas \
~/wrf-hydro-training/output/free_lesson_states/run_template
cp ~/wrf-hydro-training/example_case/Gridded_no_lakes/hydro.namelist \
~/wrf-hydro-training/output/free_lesson_states/run_template

Review the current soil parameters

Examine the soil types:

In [2]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template/DOMAIN
ncdump -v SCT_DOM geo_em.d01.nc | tail -n 20
data:

 SCT_DOM =
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  3, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ;
}

Examine the porosity values:

In [3]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template/DOMAIN
ncdump -v smcmax soil_properties.nc | tail -n 20
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.476, 0.476, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.476, 0.476, 0.476, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.476, 0.476, 0.476, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.476, 0.476, 0.476, 0.476, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434 ;
}

Examine the field capacity values:

In [4]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template/DOMAIN
ncdump -v smcref soil_properties.nc | tail -n 20
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.36, 0.36, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312,
  0.36, 0.36, 0.36, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312,
  0.36, 0.36, 0.36, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312,
  0.312, 0.36, 0.36, 0.36, 0.36, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312 ;
}

Examine the wilting point values:

In [5]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template/DOMAIN
ncdump -v smcwlt soil_properties.nc | tail -n 20
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.084, 0.084, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.084, 0.084, 0.084, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.084, 0.084, 0.084, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.084, 0.084, 0.084, 0.084, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047 ;
}

Examine the SOILPARM TBL file:

In [6]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template
cat SOILPARM.TBL | head -n 22
Soil Parameters
STAS
19,1   'BB      DRYSMC      F11     MAXSMC   REFSMC   SATPSI  SATDK      SATDW     WLTSMC  QTZ    '
1,     2.79,    0.010,    -0.472,   0.339,   0.192,   0.069,  4.66E-5,  2.65E-5,   0.010,  0.92, 'SAND'
2,     4.26,    0.028,    -1.044,   0.421,   0.283,   0.036,  1.41E-5,  5.14E-6,   0.028,  0.82, 'LOAMY SAND'
3,     4.74,    0.047,    -0.569,   0.434,   0.312,   0.141,  5.23E-6,  8.05E-6,   0.047,  0.60, 'SANDY LOAM'
4,     5.33,    0.084,     0.162,   0.476,   0.360,   0.759,  2.81E-6,  2.39E-5,   0.084,  0.25, 'SILT LOAM'
5,     3.86,    0.061,     0.162,   0.484,   0.347,   0.955,  2.18E-6,  1.66E-5,   0.061,  0.10, 'SILT'
6,     5.25,    0.066,    -0.327,   0.439,   0.329,   0.355,  3.38E-6,  1.43E-5,   0.066,  0.40, 'LOAM'
7,     6.77,    0.069,    -1.491,   0.404,   0.315,   0.135,  4.45E-6,  1.01E-5,   0.069,  0.60, 'SANDY CLAY LOAM'
8,     8.72,    0.120,    -1.118,   0.464,   0.387,   0.617,  2.03E-6,  2.35E-5,   0.120,  0.10, 'SILTY CLAY LOAM'
9,     8.17,    0.103,    -1.297,   0.465,   0.382,   0.263,  2.45E-6,  1.13E-5,   0.103,  0.35, 'CLAY LOAM'
10,   10.73,    0.100,    -3.209,   0.406,   0.338,   0.098,  7.22E-6,  1.87E-5,   0.100,  0.52, 'SANDY CLAY'
11,   10.39,    0.126,    -1.916,   0.468,   0.404,   0.324,  1.34E-6,  9.64E-6,   0.126,  0.10, 'SILTY CLAY'
12,   11.55,    0.138,    -2.138,   0.468,   0.412,   0.468,  9.74E-7,  1.12E-5,   0.138,  0.25, 'CLAY'
13,    5.25,    0.066,    -0.327,   0.439,   0.329,   0.355,  3.38E-6,  1.43E-5,   0.066,  0.05, 'ORGANIC MATERIAL'
14,     0.0,      0.0,       0.0,     1.0,     0.0,     0.0,      0.0,      0.0,     0.0,  0.60, 'WATER'
15,    2.79,    0.006,    -1.111,    0.20,    0.17,   0.069,  1.41E-4,  1.36E-4,   0.006,  0.07, 'BEDROCK'
16,    4.26,    0.028,    -1.044,   0.421,   0.283,   0.036,  1.41E-5,  5.14E-6,   0.028,  0.25, 'OTHER(land-ice)'
17,   11.55,    0.030,   -10.472,   0.468,   0.454,   0.468,  9.74E-7,  1.12E-5,   0.030,  0.60, 'PLAYA'
18,    2.79,    0.006,    -0.472,   0.200,    0.17,   0.069,  1.41E-4,  1.36E-4,   0.006,  0.52, 'LAVA'
19,    2.79,     0.01,    -0.472,   0.339,   0.192,   0.069,  4.66E-5,  2.65E-5,    0.01,  0.92, 'WHITE SAND'

Examine the current TOTAL soil moisture states (top layer):

In [7]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template/RESTART
ncdump -v smc1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 20
    0.3241273, 0.2848628,
  0.2878929, 0.286404, 0.3320683, 0.2871909, 0.2939055, 0.2997488, 0.3034452, 
    0.2934671, 0.2967317, 0.2892281, 0.2969643, 0.3116803, 0.2942242, 
    0.2830596, 0.2929517,
  0.287324, 0.2861029, 0.3263421, 0.2877018, 0.2880838, 0.2992367, 0.3018231, 
    0.2910863, 0.2954588, 0.3013191, 0.3151751, 0.3181852, 0.3024755, 
    0.2966323, 0.2920159,
  0.2880358, 0.3600812, 0.3785742, 0.2873602, 0.3181576, 0.3051807, 
    0.3247511, 0.2890431, 0.301984, 0.3044442, 0.3002283, 0.2949319, 
    0.2999392, 0.2925487, 0.2908856,
  0.3457815, 0.349177, 0.3400861, 0.2959542, 0.2881253, 0.2914036, 0.3098649, 
    0.2900718, 0.2954675, 0.3024615, 0.2963796, 0.3006322, 0.313046, 
    0.2907226, 0.2912283,
  0.3595737, 0.3618651, 0.3537213, 0.2972717, 0.2886462, 0.2889938, 
    0.3086931, 0.289906, 0.3062456, 0.3109588, 0.2968095, 0.3069569, 
    0.2968069, 0.2897979, 0.29117,
  0.2875483, 0.3613657, 0.3603568, 0.3541142, 0.3752055, 0.2910095, 
    0.2916633, 0.2923159, 0.2927783, 0.2942164, 0.2934008, 0.2929166, 
    0.2925343, 0.2919931, 0.3037168 ;
}

Examine the current LIQUID soil moisture states (top layer):

In [8]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_template/RESTART
ncdump -v sh2ox1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 20
    0.3241273, 0.2848628,
  0.2878929, 0.286404, 0.3320683, 0.2871909, 0.2939055, 0.2997488, 0.3034452, 
    0.2934671, 0.2967317, 0.2892281, 0.2969643, 0.3116803, 0.2942242, 
    0.2830596, 0.2929517,
  0.287324, 0.2861029, 0.3263421, 0.2877018, 0.2880838, 0.2992367, 0.3018231, 
    0.2910863, 0.2954588, 0.3013191, 0.3151751, 0.3181852, 0.3024755, 
    0.2966323, 0.2920159,
  0.2880358, 0.3600812, 0.3785742, 0.2873602, 0.3181576, 0.3051807, 
    0.3247511, 0.2890431, 0.301984, 0.3044442, 0.3002283, 0.2949319, 
    0.2999392, 0.2925487, 0.2908856,
  0.3457815, 0.349177, 0.3400861, 0.2959542, 0.2881253, 0.2914036, 0.3098649, 
    0.2900718, 0.2954675, 0.3024615, 0.2963796, 0.3006322, 0.313046, 
    0.2907226, 0.2912283,
  0.3595737, 0.3618651, 0.3537213, 0.2972717, 0.2886462, 0.2889938, 
    0.3086931, 0.289906, 0.3062456, 0.3109588, 0.2968095, 0.3069569, 
    0.2968069, 0.2897979, 0.29117,
  0.2875483, 0.3613657, 0.3603568, 0.3541142, 0.3752055, 0.2910095, 
    0.2916633, 0.2923159, 0.2927783, 0.2942164, 0.2934008, 0.2929166, 
    0.2925343, 0.2919931, 0.3037168 ;
}

Decide what values you want to use for high, medium, and low soil moisture initial conditions.

Modify restart soil moisture states to be saturated (or close)

Copy the template directory:

In [9]:
%%bash
cp -r ~/wrf-hydro-training/output/free_lesson_states/run_template \
~/wrf-hydro-training/output/free_lesson_states/run_saturated

Modify the top layer total soil moisture content in the HYDRO restart file:

In [10]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_saturated/RESTART
ncap2 -O -s "smc1=smc1*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v smc1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434 ;
}

Repeat for the other 3 soil layers:

In [11]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_saturated/RESTART
ncap2 -O -s "smc2=smc2*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc3=smc3*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc4=smc4*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v smc4 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434 ;
}

Modify the liquid soil moisture content for all layers in the HYDRO restart file:

In [12]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_saturated/RESTART
ncap2 -O -s "sh2ox1=sh2ox1*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox2=sh2ox2*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox3=sh2ox3*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox4=sh2ox4*0.0+0.434" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v sh2ox4 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434,
  0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 0.434, 
    0.434, 0.434, 0.434, 0.434, 0.434 ;
}

Run the model:

In [13]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_saturated
mpirun -np 2 ./wrf_hydro.exe >> run.log 2>&1

Modify restart soil moisture states to be at field capcity (or close)

Copy the template directory:

In [14]:
%%bash
cp -r ~/wrf-hydro-training/output/free_lesson_states/run_template \
~/wrf-hydro-training/output/free_lesson_states/run_fieldcap

Modify the total soil moisture content for all layers in the HYDRO restart file:

In [15]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_fieldcap/RESTART
ncap2 -O -s "smc1=smc1*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc2=smc2*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc3=smc3*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc4=smc4*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v smc4 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312 ;
}

Modify the liquid soil moisture content for all layers in the HYDRO restart file:

In [16]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_fieldcap/RESTART
ncap2 -O -s "sh2ox1=sh2ox1*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox2=sh2ox2*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox3=sh2ox3*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox4=sh2ox4*0.0+0.312" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v sh2ox4 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312,
  0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 0.312, 
    0.312, 0.312, 0.312, 0.312, 0.312 ;
}

Run the model:

In [17]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_fieldcap
mpirun -np 2 ./wrf_hydro.exe >> run.log 2>&1

Modify restart soil moisture states to be at wilting point (or close)

Copy the template directory:

In [18]:
%%bash
cp -r ~/wrf-hydro-training/output/free_lesson_states/run_template \
~/wrf-hydro-training/output/free_lesson_states/run_wiltpoint

Modify the total soil moisture content for all layers in the HYDRO restart file:

In [19]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_wiltpoint/RESTART
ncap2 -O -s "smc1=smc1*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc2=smc2*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc3=smc3*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "smc4=smc4*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v smc4 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047 ;
}

Modify the liquid soil moisture content for all layers in the HYDRO restart file:

In [20]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_wiltpoint/RESTART
ncap2 -O -s "sh2ox1=sh2ox1*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox2=sh2ox2*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox3=sh2ox3*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncap2 -O -s "sh2ox4=sh2ox4*0.0+0.047" HYDRO_RST.2011-08-26_00\:00_DOMAIN1 HYDRO_RST.2011-08-26_00\:00_DOMAIN1
ncdump -v sh2ox4 HYDRO_RST.2011-08-26_00\:00_DOMAIN1 | tail -n 10
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047,
  0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 0.047, 
    0.047, 0.047, 0.047, 0.047, 0.047 ;
}

Run the model:

In [21]:
%%bash
cd ~/wrf-hydro-training/output/free_lesson_states/run_wiltpoint
mpirun -np 2 ./wrf_hydro.exe >> run.log 2>&1

Plot the resulting hydrographs

In [22]:
# Load the xarray package
%matplotlib inline
import xarray as xr
import matplotlib.pyplot as plt
import pandas as pd
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()

chanobs_baseline = xr.open_mfdataset('/home/docker/wrf-hydro-training/output/lesson5/run_gridded_baseline/*CHANOBS*',
                            combine='by_coords')
chanobs_sat = xr.open_mfdataset('/home/docker/wrf-hydro-training/output/free_lesson_states/run_saturated/*CHANOBS*',
                            combine='by_coords')
chanobs_fc = xr.open_mfdataset('/home/docker/wrf-hydro-training/output/free_lesson_states/run_fieldcap/*CHANOBS*',
                            combine='by_coords')
chanobs_wp = xr.open_mfdataset('/home/docker/wrf-hydro-training/output/free_lesson_states/run_wiltpoint/*CHANOBS*',
                            combine='by_coords')

fig, axes = plt.subplots(ncols=1,figsize=(12, 6))
plt.suptitle('Hydrographs for soil initial states',fontsize=24)
chanobs_baseline.sel(feature_id = 2).streamflow.plot(label='Baseline',
                                                        color='black',
                                                        linestyle='--')
chanobs_sat.sel(feature_id = 2).streamflow.plot(label='Saturated',
                                                        color='blue',
                                                        linestyle='-')
chanobs_fc.sel(feature_id = 2).streamflow.plot(label='Field Capacity',
                                                        color='green',
                                                        linestyle='-')
chanobs_wp.sel(feature_id = 2).streamflow.plot(label='Wilting Point',
                                                        color='red',
                                                        linestyle='-')


plt.ylim(0,70)
plt.legend()
plt.show()
In [ ]: