CP2K 2.4 (Revision 12889)
Classes | Functions | Variables

input_val_types Namespace Reference

a wrapper for basic fortran types. More...

Classes

struct  val_p_type
 pointer to a val, to create arrays of pointers More...
struct  val_type
 a type to have a wrapper that stores any basic fortran type More...

Functions

subroutine, public val_create (val, l_val, l_vals, l_vals_ptr, i_val, i_vals, i_vals_ptr, r_val, r_vals, r_vals_ptr, c_val, c_vals, c_vals_ptr, lc_val, lc_vals, lc_vals_ptr, enum, error)
 creates a keyword value
subroutine, public val_release (val, error)
 releases the given val
subroutine, public val_retain (val, error)
 retains the given val
subroutine, public val_get (val, has_l, has_i, has_r, has_lc, has_c, l_val, l_vals, i_val, i_vals, r_val, r_vals, c_val, c_vals, len_c, type_of_var, enum, error)
 returns the stored values
subroutine, public val_write (val, unit_nr, unit, unit_str, fmt, error)
 writes out the valuse stored in the val
subroutine, public val_write_internal (val, string, unit, error)
 Write values to an internal file, i.e. string variable.
subroutine, public val_duplicate (val_in, val_out, error)
 creates a copy of the given value

Variables

LOGICAL, parameter, private debug_this_module = .TRUE.
CHARACTER(len=*), parameter,
private 
moduleN = 'input_val_types'
INTEGER, save, private last_val_id = 0
INTEGER, parameter, public no_t = 0
INTEGER, parameter, public logical_t = 1
INTEGER, parameter, public integer_t = 2
INTEGER, parameter, public real_t = 3
INTEGER, parameter, public char_t = 4
INTEGER, parameter, public enum_t = 5
INTEGER, parameter, public lchar_t = 6

Detailed Description

a wrapper for basic fortran types.

History
06.2004 created
Author:
fawzi

Function Documentation

subroutine,public input_val_types::val_create ( TYPE(val_type),pointer  val,
LOGICAL,intent(in),optional  l_val,
LOGICAL,dimension(:),intent(in),optional  l_vals,
LOGICAL,dimension(:),optional,pointer  l_vals_ptr,
INTEGER,intent(in),optional  i_val,
INTEGER,dimension(:),intent(in),optional  i_vals,
INTEGER,dimension(:),optional,pointer  i_vals_ptr,
REAL(KIND=DP),intent(in),optional  r_val,
REAL(KIND=DP),dimension(:),intent(in),optional  r_vals,
REAL(KIND=DP),dimension(:),optional,pointer  r_vals_ptr,
CHARACTER(LEN=*),intent(in),optional  c_val,
CHARACTER(LEN=*),dimension(:),intent(in),optional  c_vals,
CHARACTER(LEN=DEFAULT_STRING_LENGTH),dimension(:),optional,pointer  c_vals_ptr,
CHARACTER(LEN=*),intent(in),optional  lc_val,
CHARACTER(LEN=*),dimension(:),intent(in),optional  lc_vals,
CHARACTER(LEN=DEFAULT_STRING_LENGTH),dimension(:),optional,pointer  lc_vals_ptr,
TYPE(enumeration_type),optional,pointer  enum,
TYPE(cp_error_type),intent(inout)  error 
)

creates a keyword value

Parameters:
valthe object to be created
l_val,i_val,r_val,c_val,lc_val,:a logical,integer,real,string, long string to be stored in the val
l_vals,i_vals,r_vals,c_vals,:an array of logicals, integers, reals, characters, long strings to be stored in val
l_vals_ptr,i_vals_ptr,r_vals_ptr,c_vals_ptr,:an array of logicals, ... to be stored in val, val will get the ownership of the pointer
enumthe enumaration type this value is using
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
using an enumeration only i_val/i_vals/i_vals_ptr are accepted
Author:
fawzi

Definition at line 92 of file input_val_types.f90.

References char_t, CPAssert, CPPostcondition, kinds::default_string_length, enum_t, error, integer_t, last_val_id, lchar_t, logical_t, no_t, and real_t.

Referenced by input_cp2k_restarts::dump_csvr_energy_info(), input_keyword_types::keyword_create(), input_cp2k_restarts::meta_hills_val_set_ds(), input_cp2k_restarts::meta_hills_val_set_dt(), input_cp2k_restarts::meta_hills_val_set_ss(), input_cp2k_restarts::meta_hills_val_set_ww(), input_cp2k_restarts::section_coord_val_set(), input_cp2k_restarts::section_neb_coord_val_set(), input_cp2k_restarts::section_rng_val_set(), input_cp2k_restarts::section_velocity_val_set(), input_cp2k_restarts::update_dipoles_section(), input_cp2k_restarts::update_quadrupoles_section(), and input_parsing::val_create_parsing().

Here is the caller graph for this function:

subroutine,public input_val_types::val_duplicate ( TYPE(val_type),pointer  val_in,
TYPE(val_type),pointer  val_out,
TYPE(cp_error_type),intent(inout)  error 
)

creates a copy of the given value

Parameters:
val_inthe value to copy
val_outthe value tha will be created
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 792 of file input_val_types.f90.

References CPPostcondition, and last_val_id.

subroutine,public input_val_types::val_get ( TYPE(val_type),pointer  val,
LOGICAL,intent(out),optional  has_l,
LOGICAL,intent(out),optional  has_i,
LOGICAL,intent(out),optional  has_r,
LOGICAL,intent(out),optional  has_lc,
LOGICAL,intent(out),optional  has_c,
LOGICAL,intent(out),optional  l_val,
LOGICAL,dimension(:),optional,pointer  l_vals,
INTEGER,intent(out),optional  i_val,
INTEGER,dimension(:),optional,pointer  i_vals,
REAL(KIND=DP),intent(out),optional  r_val,
REAL(KIND=DP),dimension(:),optional,pointer  r_vals,
CHARACTER(LEN=*),intent(out),optional  c_val,
CHARACTER(LEN=DEFAULT_STRING_LENGTH),dimension(:),optional,pointer  c_vals,
INTEGER,intent(out),optional  len_c,
INTEGER,intent(out),optional  type_of_var,
TYPE(enumeration_type),optional,pointer  enum,
TYPE(cp_error_type),intent(inout)  error 
)

returns the stored values

Parameters:
valthe object from which you want to extract the values
l_val,i_val,r_val,c_val,:gets a logical, integer, real, char from the val
logical_valsgets an array of logicals, integers, reals, chars from the val
len_clen_trim of c_val (if it was a lc_val, of type lchar_t it might be longet than default_string_length)
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
using an enumeration only i_val/i_vals/i_vals_ptr are accepted add something like ignore_string_cut that if true does not warn if the c_val is too short to contain the string
Author:
fawzi

Definition at line 376 of file input_val_types.f90.

References CPAssert, kinds::default_string_length, input_enumeration_types::enum_i2c(), error, and lchar_t.

Referenced by force_fields_all::force_field_pack_charges(), md_vel_utils::initialize_cascade(), md_vel_utils::initialize_velocities(), external_potential_types::read_all_potential(), atoms_input::read_atoms_input(), atom_types::read_basis_set(), basis_set_types::read_geminal_basis_set(), external_potential_types::read_gth_potential(), atom_types::read_gth_potential(), basis_set_types::read_gto_basis_set(), atoms_input::read_shell_coord_input(), and val_write_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public input_val_types::val_release ( TYPE(val_type),pointer  val,
TYPE(cp_error_type),intent(inout)  error 
)

releases the given val

Parameters:
valthe val to release
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 293 of file input_val_types.f90.

References CPPostconditionNoFail, CPPreconditionNoFail, and no_t.

Referenced by input_keyword_types::keyword_create(), and input_keyword_types::keyword_release().

Here is the caller graph for this function:

subroutine,public input_val_types::val_retain ( TYPE(val_type),pointer  val,
TYPE(cp_error_type),intent(inout)  error 
)

retains the given val

Parameters:
valthe val to retain
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 341 of file input_val_types.f90.

References CPPreconditionNoFail.

Referenced by input_keyword_types::keyword_create().

Here is the caller graph for this function:

subroutine,public input_val_types::val_write ( TYPE(val_type),pointer  val,
INTEGER,intent(in)  unit_nr,
TYPE(cp_unit_type),optional,pointer  unit,
CHARACTER(len=*),intent(in),optional  unit_str,
CHARACTER(len=*),intent(in),optional  fmt,
TYPE(cp_error_type),intent(inout)  error 
)

writes out the valuse stored in the val

Parameters:
valthe val to write
unit_nrthe number of the unit to write to
unitthe unit of mesure in wich the output should be written (overrides unit_str)
unit_strthe unit of mesure in wich the output should be written
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
unit of mesure used only for reals
Author:
fawzi

Definition at line 528 of file input_val_types.f90.

References char_t, cp_units::cp_unit_create(), CPAssert, cp_parser_types::default_continuation_character, input_enumeration_types::enum_i2c(), enum_t, integer_t, lchar_t, logical_t, no_t, and real_t.

Referenced by input_keyword_types::keyword_describe(), input_keyword_types::keyword_describe_html(), and input_parsing::section_vals_parse().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public input_val_types::val_write_internal ( TYPE(val_type),pointer  val,
CHARACTER(LEN=*),intent(out)  string,
TYPE(cp_unit_type),optional,pointer  unit,
TYPE(cp_error_type),intent(inout)  error 
)

Write values to an internal file, i.e. string variable.

Author:
MK
Date:
10.03.2005
History
17.01.2006, MK, Optional argument unit for the conversion to the external unit added
Version:
1.0

Definition at line 691 of file input_val_types.f90.

References char_t, CPAssert, input_enumeration_types::enum_i2c(), enum_t, integer_t, lchar_t, logical_t, real_t, and val_get().

Referenced by input_keyword_types::write_keyword_xml().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

INTEGER,parameter,public input_val_types::char_t = 4

Definition at line 43 of file input_val_types.f90.

Referenced by input_cp2k_free_energy::create_ac_section(), input_cp2k_atom::create_atom_section(), input_cp2k_mm::create_BEND_section(), input_cp2k_mm::create_BMHFT_section(), input_cp2k_mm::create_BMHFTD_section(), input_cp2k_mm::create_BOND_section(), input_cp2k_mm::create_Buck4r_section(), input_cp2k_mm::create_Buckmorse_section(), input_cp2k_mm::create_charge_section(), input_cp2k_constraints::create_collective_section(), input_cp2k_colvar::create_colvar_comb_section(), input_cp2k_colvar::create_colvar_cond_dist_section(), input_cp2k_colvar::create_colvar_coord_section(), input_cp2k_colvar::create_colvar_gyr_section(), input_cp2k_colvar::create_colvar_pop_section(), input_cp2k_colvar::create_colvar_u_section(), input_cp2k_mm::create_damping_section(), input_cp2k_dft::create_dft_section(), input_cp2k_dft::create_dftb_parameter_section(), input_cp2k_mm::create_dipole_section(), input_cp2k_mm::create_EAM_section(), input_cp2k_subsys::create_exclude_list_section(), input_cp2k_force_eval::create_ext_pot_section(), input_cp2k_dft::create_ext_pot_section(), input_cp2k::create_ext_restart_section(), input_cp2k_constraints::create_fixed_atom_section(), input_cp2k_constraints::create_g3x3_section(), input_cp2k_constraints::create_g4x6_section(), input_cp2k_mm::create_GENPOT_section(), input_cp2k::create_global_section(), input_cp2k_mm::create_Goodwin_section(), input_cp2k_constraints::create_hbonds_section(), input_cp2k_mm::create_IMPROPER_section(), input_cp2k_mm::create_ipbv_section(), input_cp2k_subsys::create_kind_section(), input_cp2k_xc::create_libxc_section(), input_cp2k_mm::create_LJ_section(), input_cp2k_mixed::create_mix_section(), input_cp2k_resp::create_nonperiodic_sys_section(), input_cp2k_mm::create_OPBEND_section(), input_optimize_basis::create_optimize_basis_section(), input_optimize_input::create_optimize_input_section(), input_cp2k_qmmm::create_qmmm_force_mixing_section(), input_cp2k_qmmm::create_qmmm_link_section(), input_cp2k_qmmm::create_qmmm_mm_kinds(), input_cp2k_qmmm::create_qmmm_qm_kinds(), input_cp2k_mm::create_quadrupole_section(), input_cp2k_thermostats::create_region_section(), input_cp2k_dft::create_scptb_control_section(), input_cp2k_mm::create_Siepmann_section(), input_cp2k_mm::create_Tersoff_section(), input_cp2k_mm::create_TORSION_section(), input_cp2k_xc::create_vdw_potential_section(), input_cp2k_constraints::create_vsite_section(), input_cp2k_mm::create_Williams_section(), input_keyword_types::keyword_create(), input_keyword_types::keyword_describe(), input_keyword_types::keyword_describe_html(), input_cp2k_colvar::keywords_colvar_path(), val_create(), input_parsing::val_create_parsing(), val_write(), val_write_internal(), and input_keyword_types::write_keyword_xml().

LOGICAL,parameter,private input_val_types::debug_this_module = .TRUE.

Definition at line 33 of file input_val_types.f90.

INTEGER,parameter,public input_val_types::enum_t = 5
INTEGER,parameter,public input_val_types::integer_t = 2

Definition at line 36 of file input_val_types.f90.

Referenced by val_create(), and val_duplicate().

INTEGER,parameter,public input_val_types::lchar_t = 6
INTEGER,parameter,public input_val_types::logical_t = 1
CHARACTER(len=*),parameter,private input_val_types::moduleN = 'input_val_types'

Definition at line 34 of file input_val_types.f90.

INTEGER,parameter,public input_val_types::no_t = 0
INTEGER,parameter,public input_val_types::real_t = 3