5.13.2-dev0
mHM
The mesoscale Hydrological Model
Loading...
Searching...
No Matches
mo_mpr_restart Module Reference

reading and writing states, fluxes and configuration for restart of mHM. More...

Data Types

interface  unpack_field_and_write
 unpack parameter fields and write them to file More...
 

Functions/Subroutines

subroutine, public write_mpr_restart_files (outfile)
 write restart files for each domain
 
subroutine, public write_eff_params (mask1, s1, e1, rows1, cols1, soil1, lcscenes, lais, nc)
 write effective parameter fields to given restart file
 
subroutine unpack_field_and_write_1d_i4 (nc, var_name, var_dims, fill_value, data, mask, var_long_name)
 unpack parameter fields and write them to file
 
subroutine unpack_field_and_write_1d_dp (nc, var_name, var_dims, fill_value, data, mask, var_long_name)
 unpack parameter fields and write them to file
 
subroutine unpack_field_and_write_2d_dp (nc, var_name, var_dims, fill_value, data, mask, var_long_name)
 unpack parameter fields and write them to file
 
subroutine unpack_field_and_write_3d_dp (nc, var_name, var_dims, fill_value, data, mask, var_long_name)
 unpack parameter fields and write them to file
 

Detailed Description

reading and writing states, fluxes and configuration for restart of mHM.

routines are seperated for reading and writing variables for:

  • states and fluxes, and
  • configuration.

Reading of L11 configuration is also seperated from the rest, since it is only required when routing is activated.

Authors
Stephan Thober
Date
Jul 2013

Function/Subroutine Documentation

◆ unpack_field_and_write_1d_dp()

subroutine mo_mpr_restart::unpack_field_and_write_1d_dp ( type(ncdataset), intent(inout)  nc,
character(*), intent(in)  var_name,
type(ncdimension), dimension(:), intent(in)  var_dims,
real(dp), intent(in)  fill_value,
real(dp), dimension(:), intent(in)  data,
logical, dimension(:, :), intent(in)  mask,
character(*), intent(in), optional  var_long_name 
)
private

unpack parameter fields and write them to file

Parameters
[in,out]type(NcDataset) :: ncNcDataset to add variable to
[in]character(*) :: var_namevariable name
[in]type(NcDimension), dimension(:) :: var_dimsvector of Variable dimensions
[in]integer(i4) :: fill_valuefill value used for missing values
[in]integer(i4/dp), dimension(...) :: datapacked data to be set to variable
[in]logical, dimension(:, :) :: maskmask used for unpacking
[in]character(*), optional :: var_long_namevariable long name attribute
Authors
Robert Schweppe
Date
Jun 2018

Definition at line 393 of file mo_mpr_restart.f90.

◆ unpack_field_and_write_1d_i4()

subroutine mo_mpr_restart::unpack_field_and_write_1d_i4 ( type(ncdataset), intent(inout)  nc,
character(*), intent(in)  var_name,
type(ncdimension), dimension(:), intent(in)  var_dims,
integer(i4), intent(in)  fill_value,
integer(i4), dimension(:), intent(in)  data,
logical, dimension(:, :), intent(in)  mask,
character(*), intent(in), optional  var_long_name 
)
private

unpack parameter fields and write them to file

Parameters
[in,out]type(NcDataset) :: ncNcDataset to add variable to
[in]character(*) :: var_namevariable name
[in]type(NcDimension), dimension(:) :: var_dimsvector of Variable dimensions
[in]integer(i4) :: fill_valuefill value used for missing values
[in]integer(i4/dp), dimension(...) :: datapacked data to be set to variable
[in]logical, dimension(:, :) :: maskmask used for unpacking
[in]character(*), optional :: var_long_namevariable long name attribute
Authors
Robert Schweppe
Date
Jun 2018

Definition at line 347 of file mo_mpr_restart.f90.

◆ unpack_field_and_write_2d_dp()

subroutine mo_mpr_restart::unpack_field_and_write_2d_dp ( type(ncdataset), intent(inout)  nc,
character(*), intent(in)  var_name,
type(ncdimension), dimension(:), intent(in)  var_dims,
real(dp), intent(in)  fill_value,
real(dp), dimension(:, :), intent(in)  data,
logical, dimension(:, :), intent(in)  mask,
character(*), intent(in), optional  var_long_name 
)
private

unpack parameter fields and write them to file

Parameters
[in,out]type(NcDataset) :: ncNcDataset to add variable to
[in]character(*) :: var_namevariable name
[in]type(NcDimension), dimension(:) :: var_dimsvector of Variable dimensions
[in]integer(i4) :: fill_valuefill value used for missing values
[in]integer(i4/dp), dimension(...) :: datapacked data to be set to variable
[in]logical, dimension(:, :) :: maskmask used for unpacking
[in]character(*), optional :: var_long_namevariable long name attribute
Authors
Robert Schweppe
Date
Jun 2018

Definition at line 439 of file mo_mpr_restart.f90.

◆ unpack_field_and_write_3d_dp()

subroutine mo_mpr_restart::unpack_field_and_write_3d_dp ( type(ncdataset), intent(inout)  nc,
character(*), intent(in)  var_name,
type(ncdimension), dimension(:), intent(in)  var_dims,
real(dp), intent(in)  fill_value,
real(dp), dimension(:, :, :), intent(in)  data,
logical, dimension(:, :), intent(in)  mask,
character(*), intent(in), optional  var_long_name 
)
private

unpack parameter fields and write them to file

Parameters
[in,out]type(NcDataset) :: ncNcDataset to add variable to
[in]character(*) :: var_namevariable name
[in]type(NcDimension), dimension(:) :: var_dimsvector of Variable dimensions
[in]integer(i4) :: fill_valuefill value used for missing values
[in]integer(i4/dp), dimension(...) :: datapacked data to be set to variable
[in]logical, dimension(:, :) :: maskmask used for unpacking
[in]character(*), optional :: var_long_namevariable long name attribute
Authors
Robert Schweppe
Date
Jun 2018

Definition at line 497 of file mo_mpr_restart.f90.

◆ write_eff_params()

subroutine, public mo_mpr_restart::write_eff_params ( logical, dimension(:, :), intent(in), allocatable  mask1,
integer(i4), intent(in)  s1,
integer(i4), intent(in)  e1,
type(ncdimension), intent(in)  rows1,
type(ncdimension), intent(in)  cols1,
type(ncdimension), intent(in)  soil1,
type(ncdimension), intent(in)  lcscenes,
type(ncdimension), intent(in)  lais,
type(ncdataset), intent(inout)  nc 
)

write effective parameter fields to given restart file

Changelog
  • Rohini Kumar Oct 2021
    • Added Neutron count module to mHM integrate into develop branch (5.11.2)
  • Sebastian Müller Mar 2023
    • made L1_alpha, L1_kSlowFlow, L1_kBaseFlow and L1_kPerco land cover dependent
Authors
Robert Schweppe
Date
Jun 2018
Parameters
[in]mask1mask at level 1
[in]s1start index at level 1
[in]e1end index at level 1
[in]rows1y dimension
[in]cols1x dimension
[in]soil1soil dimension
[in]lcscenesland conver scenes dimension
[in]laisLAI dimension
[in,out]ncNetCDF file to write to

Definition at line 160 of file mo_mpr_restart.f90.

References mo_mpr_global_variables::l1_aeroresist, mo_mpr_global_variables::l1_alpha, mo_mpr_global_variables::l1_bulkdens, mo_mpr_global_variables::l1_cosmicl3, mo_mpr_global_variables::l1_degday, mo_mpr_global_variables::l1_degdayinc, mo_mpr_global_variables::l1_degdaymax, mo_mpr_global_variables::l1_degdaynopre, mo_mpr_global_variables::l1_fasp, mo_mpr_global_variables::l1_froots, mo_mpr_global_variables::l1_fsealed, mo_mpr_global_variables::l1_harsamcoeff, mo_mpr_global_variables::l1_jarvis_thresh_c1, mo_mpr_global_variables::l1_karstloss, mo_mpr_global_variables::l1_kbaseflow, mo_mpr_global_variables::l1_kfastflow, mo_mpr_global_variables::l1_kperco, mo_mpr_global_variables::l1_kslowflow, mo_mpr_global_variables::l1_latticewater, mo_mpr_global_variables::l1_maxinter, mo_mpr_global_variables::l1_no_count, mo_mpr_global_variables::l1_petlaicorfactor, mo_mpr_global_variables::l1_prietayalpha, mo_mpr_global_variables::l1_sealedthresh, mo_mpr_global_variables::l1_soilmoistexp, mo_mpr_global_variables::l1_soilmoistfc, mo_mpr_global_variables::l1_soilmoistsat, mo_mpr_global_variables::l1_surfresist, mo_mpr_global_variables::l1_tempthresh, mo_mpr_global_variables::l1_unsatthresh, mo_mpr_global_variables::l1_wiltingpoint, mo_common_variables::lc_year_end, mo_common_variables::lc_year_start, mo_common_constants::nodata_dp, mo_common_constants::nodata_i4, and mo_common_variables::processmatrix.

Referenced by write_mpr_restart_files(), and mo_restart::write_restart_files().

Here is the caller graph for this function:

◆ write_mpr_restart_files()

subroutine, public mo_mpr_restart::write_mpr_restart_files ( character(256), dimension(:), intent(in)  outfile)

write restart files for each domain

write restart files for each domain. For each domain three restart files are written. These are xxx_states.nc, xxx_L11_config.nc, and xxx_config.nc (xxx being the three digit domain index). If a variable is added here, it should also be added in the read restart routines below. ADDITIONAL INFORMATION write_restart

Changelog
  • Stephan Thober Aug 2015
    • moved write of routing states to mRM
  • David Schaefer Nov 2015
    • mo_netcdf
  • Stephan Thober Nov 2016
    • moved processMatrix to common variables
  • Zink M. Demirel C. Mar 2017
    • Added Jarvis soil water stress function at SM process(3)
Authors
Stephan Thober
Date
Jun 2014
Parameters
[in]outfileOutput Path for each domain

Definition at line 69 of file mo_mpr_restart.f90.

References mo_common_variables::domainmeta, mo_mpr_global_variables::horizondepth_mhm, mo_common_constants::laivarname, mo_common_constants::landcoverperiodsvarname, mo_common_variables::lc_year_end, mo_common_variables::lc_year_start, mo_common_variables::level1, mo_mpr_global_variables::nlai, mo_common_variables::nlcoverscene, mo_mpr_global_variables::nsoilhorizons_mhm, mo_common_constants::soilhorizonsvarname, write_eff_params(), and mo_common_restart::write_grid_info().

Here is the call graph for this function: