IMEX_SfloW2D  0.9
Shallowwatergranularflowmodel
Functions/Subroutines | Variables
inpout_2d Module Reference

Input/Output module. More...

Functions/Subroutines

subroutine init_param
 Initialization of the variables read from the input file. More...
 
subroutine read_param
 Read the input file. More...
 
subroutine update_param
 Read the input file. More...
 
subroutine read_solution
 Read the solution from the restart unit. More...
 
subroutine output_solution (time)
 Write the solution on the output unit. More...
 
subroutine output_esri (output_idx)
 Write the thickness in ESRI format. More...
 
subroutine close_units
 
character *4 function lettera (k)
 Numeric to String conversion. More...
 
subroutine output_probes (output_idx)
 Write solution at selected points on file. More...
 
subroutine output_runout (time, stop_flag)
 Write runout on file. More...
 

Variables

character(len=40) run_name
 Name of the run. More...
 
character(len=40) bak_name
 Backup file for the parameters. More...
 
character(len=40) input_file
 File with the run parameters. More...
 
character(len=40) output_file
 Name of the output files. More...
 
character(len=40) restart_file
 Name of the restart file. More...
 
character(len=40) probes_file
 Name of the probes file. More...
 
character(len=40) output_file_2d
 Name of the output files. More...
 
character(len=40) output_esri_file
 Name of the esri output files. More...
 
character(len=40) runout_file
 Name of the runout file. More...
 
integer, parameter input_unit = 7
 Input data unit. More...
 
integer, parameter backup_unit = 8
 Backup input data unit. More...
 
integer, parameter output_unit = 9
 Output data unit. More...
 
integer, parameter restart_unit = 10
 Restart data unit. More...
 
integer, parameter probes_unit = 11
 Probes data unit. More...
 
integer, parameter output_unit_2d = 12
 Output data 2D unit. More...
 
integer, parameter output_esri_unit = 13
 Esri Output unit. More...
 
integer, parameter dem_esri_unit = 14
 Computational grid Esri fmt unit. More...
 
integer, parameter runout_unit = 15
 
integer, parameter dakota_unit = 16
 
integer output_idx
 Counter for the output files. More...
 
logical restart
 Flag to start a run from a previous output:
. More...
 
logical output_esri_flag
 Flag to save the output in esri ascii format *.asc. More...
 
logical output_phys_flag
 Flag to save the physical variables on file *.p_2d. More...
 
logical output_cons_flag
 Flag to save the conservative variables on file *.q_2d. More...
 
logical output_runout_flag
 Flag to save the max runout at ouput times. More...
 
type(bchb_bcw
 
type(bcu_bcw
 
type(bcv_bcw
 
type(bchu_bcw
 
type(bchv_bcw
 
type(bcxs_bcw
 
type(bct_bcw
 
type(bchb_bce
 
type(bcu_bce
 
type(bcv_bce
 
type(bchu_bce
 
type(bchv_bce
 
type(bcxs_bce
 
type(bct_bce
 
type(bchb_bcs
 
type(bcu_bcs
 
type(bcv_bcs
 
type(bchu_bcs
 
type(bchv_bcs
 
type(bcxs_bcs
 
type(bct_bcs
 
type(bchb_bcn
 
type(bcu_bcn
 
type(bcv_bcn
 
type(bchu_bcn
 
type(bchv_bcn
 
type(bcxs_bcn
 
type(bct_bcn
 
integer ncols
 
integer nrows
 
integer nodata_value
 
real *8 xllcorner
 
real *8 yllcorner
 
real *8 cellsize
 
logical write_first_q
 
integer n_probes
 
real *8, dimension(:,:), allocatable probes_coords
 
real *8 dt_runout
 
real *8, dimension(:,:), allocatable h_old
 
real *8 x0_runout
 
real *8 y0_runout
 
real *8 init_runout
 
real *8 runout_mom_stop
 

Detailed Description

Input/Output module.

This module contains all the input/output subroutine and the realted variables.

Date
07/10/2016
Author
Mattia de' Michieli Vitturi

Function/Subroutine Documentation

subroutine inpout_2d::close_units ( )

Definition at line 2851 of file inpout_2d.f90.

Here is the caller graph for this function:

subroutine inpout_2d::init_param ( )

Initialization of the variables read from the input file.

This subroutine initialize the input variables with default values that solve for a Riemann problem. If the input file does not exist one is created with the default values.

Author
Mattia de' Michieli Vitturi
Date
07/10/2016

Definition at line 213 of file inpout_2d.f90.

Here is the caller graph for this function:

character*4 function inpout_2d::lettera ( integer  k)

Numeric to String conversion.

This function convert the integer in input into a numeric string for the subfix of the output files.

Parameters
[in]kinteger to convert
Date
07/10/2016
Author
Mattia de' Michieli Vitturi

Definition at line 2873 of file inpout_2d.f90.

Here is the caller graph for this function:

subroutine inpout_2d::output_esri ( integer, intent(in)  output_idx)

Write the thickness in ESRI format.

This subroutine write the thickness in the ascii ESRI format. A masking is applied to the region with thickness less than 1D-5.

Parameters
[in]output_idxoutput index
Author
Mattia de' Michieli Vitturi
Date
15/12/2016

Definition at line 2748 of file inpout_2d.f90.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine inpout_2d::output_probes ( integer, intent(in)  output_idx)

Write solution at selected points on file.

This subroutine writes on a file the thickness at selected points, defined by an appropriate card in the input file. in the initial solution.

Parameters
[in]output_idxoutput index
Author
Mattia de' Michieli Vitturi
Date
12/02/2018

Definition at line 2906 of file inpout_2d.f90.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine inpout_2d::output_runout ( real*8, intent(in)  time,
logical, intent(inout)  stop_flag 
)

Write runout on file.

This subroutine writes on a file the flow runout. It is calculated as the linear horizontal distance from the point with the highest topography value in the initial solution.

Parameters
[in]timeactual time
[in,out]stop_flaglogical to check if flow has stopped
Author
Mattia de' Michieli Vitturi
Date
12/02/2018

Definition at line 2956 of file inpout_2d.f90.

Here is the caller graph for this function:

subroutine inpout_2d::output_solution ( real*8, intent(in)  time)

Write the solution on the output unit.

This subroutine write the parameters of the grid, the output time and the solution to a file with the name "run_name.q****", where run_name is the name of the run read from the input file and **** is the counter of the output.

Parameters
[in]toutput time
Author
Mattia de' Michieli Vitturi
Date
07/10/2016

Definition at line 2573 of file inpout_2d.f90.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine inpout_2d::read_param ( )

Read the input file.

This subroutine read the input parameters from the file "two_phases.inp" and write a backup file of the input parameters with name "run_name.bak", where run_name is read from the input file.

Date
07/10/2016
Author
Mattia de' Michieli Vitturi

Definition at line 529 of file inpout_2d.f90.

Here is the caller graph for this function:

subroutine inpout_2d::read_solution ( )

Read the solution from the restart unit.

This subroutine is called when the parameter "restart" in the input file is TRUE. Then the initial solution is read from a file.

Date
07/10/2016
Author
Mattia de' Michieli Vitturi

Definition at line 2266 of file inpout_2d.f90.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine inpout_2d::update_param ( )

Read the input file.

This subroutine read the input parameters from the file "two_phases.inp" and write a backup file of the input parameters with name "run_name.bak", where run_name is read from the input file.

Date
07/10/2016
Author
Mattia de' Michieli Vitturi

Definition at line 2160 of file inpout_2d.f90.

Here is the caller graph for this function:

Variable Documentation

integer, parameter inpout_2d::backup_unit = 8

Backup input data unit.

Definition at line 77 of file inpout_2d.f90.

character(len=40) inpout_2d::bak_name

Backup file for the parameters.

Definition at line 67 of file inpout_2d.f90.

real*8 inpout_2d::cellsize

Definition at line 136 of file inpout_2d.f90.

integer, parameter inpout_2d::dakota_unit = 16

Definition at line 85 of file inpout_2d.f90.

integer, parameter inpout_2d::dem_esri_unit = 14

Computational grid Esri fmt unit.

Definition at line 83 of file inpout_2d.f90.

real*8 inpout_2d::dt_runout

Definition at line 144 of file inpout_2d.f90.

real*8, dimension(:,:), allocatable inpout_2d::h_old

Definition at line 146 of file inpout_2d.f90.

type(bc) inpout_2d::hb_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::hb_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::hb_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::hb_bcw

Definition at line 121 of file inpout_2d.f90.

type(bc) inpout_2d::hu_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::hu_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::hu_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::hu_bcw

Definition at line 121 of file inpout_2d.f90.

type(bc) inpout_2d::hv_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::hv_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::hv_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::hv_bcw

Definition at line 121 of file inpout_2d.f90.

real*8 inpout_2d::init_runout

Definition at line 148 of file inpout_2d.f90.

character(len=40) inpout_2d::input_file

File with the run parameters.

Definition at line 68 of file inpout_2d.f90.

integer, parameter inpout_2d::input_unit = 7

Input data unit.

Definition at line 76 of file inpout_2d.f90.

integer inpout_2d::n_probes

Definition at line 140 of file inpout_2d.f90.

integer inpout_2d::ncols

Definition at line 134 of file inpout_2d.f90.

integer inpout_2d::nodata_value

Definition at line 134 of file inpout_2d.f90.

integer inpout_2d::nrows

Definition at line 134 of file inpout_2d.f90.

logical inpout_2d::output_cons_flag

Flag to save the conservative variables on file *.q_2d.

  • T => write conservative variables on file
  • F => do not write the conservative variables

Definition at line 112 of file inpout_2d.f90.

character(len=40) inpout_2d::output_esri_file

Name of the esri output files.

Definition at line 73 of file inpout_2d.f90.

logical inpout_2d::output_esri_flag

Flag to save the output in esri ascii format *.asc.

  • T => write esri file
  • F => do not write esri file

Definition at line 100 of file inpout_2d.f90.

integer, parameter inpout_2d::output_esri_unit = 13

Esri Output unit.

Definition at line 82 of file inpout_2d.f90.

character(len=40) inpout_2d::output_file

Name of the output files.

Definition at line 69 of file inpout_2d.f90.

character(len=40) inpout_2d::output_file_2d

Name of the output files.

Definition at line 72 of file inpout_2d.f90.

integer inpout_2d::output_idx

Counter for the output files.

Definition at line 88 of file inpout_2d.f90.

logical inpout_2d::output_phys_flag

Flag to save the physical variables on file *.p_2d.

  • T => write physical variables on file
  • F => do not write the physical variables

Definition at line 106 of file inpout_2d.f90.

logical inpout_2d::output_runout_flag

Flag to save the max runout at ouput times.

  • T => write max runout on file
  • F => do not write max runout

Definition at line 118 of file inpout_2d.f90.

integer, parameter inpout_2d::output_unit = 9

Output data unit.

Definition at line 78 of file inpout_2d.f90.

integer, parameter inpout_2d::output_unit_2d = 12

Output data 2D unit.

Definition at line 81 of file inpout_2d.f90.

real*8, dimension(:,:), allocatable inpout_2d::probes_coords

Definition at line 142 of file inpout_2d.f90.

character(len=40) inpout_2d::probes_file

Name of the probes file.

Definition at line 71 of file inpout_2d.f90.

integer, parameter inpout_2d::probes_unit = 11

Probes data unit.

Definition at line 80 of file inpout_2d.f90.

logical inpout_2d::restart

Flag to start a run from a previous output:
.

  • T => Restart from a previous output (.asc or .q_2d)
  • F => Restart from initial condition read from two_phases.inp

Definition at line 94 of file inpout_2d.f90.

character(len=40) inpout_2d::restart_file

Name of the restart file.

Definition at line 70 of file inpout_2d.f90.

integer, parameter inpout_2d::restart_unit = 10

Restart data unit.

Definition at line 79 of file inpout_2d.f90.

character(len=40) inpout_2d::run_name

Name of the run.

Definition at line 66 of file inpout_2d.f90.

character(len=40) inpout_2d::runout_file

Name of the runout file.

Definition at line 74 of file inpout_2d.f90.

real*8 inpout_2d::runout_mom_stop

Definition at line 148 of file inpout_2d.f90.

integer, parameter inpout_2d::runout_unit = 15

Definition at line 84 of file inpout_2d.f90.

type(bc) inpout_2d::t_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::t_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::t_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::t_bcw

Definition at line 121 of file inpout_2d.f90.

type(bc) inpout_2d::u_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::u_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::u_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::u_bcw

Definition at line 121 of file inpout_2d.f90.

type(bc) inpout_2d::v_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::v_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::v_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::v_bcw

Definition at line 121 of file inpout_2d.f90.

logical inpout_2d::write_first_q

Definition at line 138 of file inpout_2d.f90.

real*8 inpout_2d::x0_runout

Definition at line 148 of file inpout_2d.f90.

real*8 inpout_2d::xllcorner

Definition at line 136 of file inpout_2d.f90.

type(bc) inpout_2d::xs_bce

Definition at line 124 of file inpout_2d.f90.

type(bc) inpout_2d::xs_bcn

Definition at line 130 of file inpout_2d.f90.

type(bc) inpout_2d::xs_bcs

Definition at line 127 of file inpout_2d.f90.

type(bc) inpout_2d::xs_bcw

Definition at line 121 of file inpout_2d.f90.

real*8 inpout_2d::y0_runout

Definition at line 148 of file inpout_2d.f90.

real*8 inpout_2d::yllcorner

Definition at line 136 of file inpout_2d.f90.