handle_hyp_file Subroutine

public subroutine handle_hyp_file(nb_hprparams, size_hprdata, hprnames, hprdata, hprdim, hprbool, requiredbool)

Subroutine for handling the method's hyper parameters.

This subroutine reads the hyperparams.txt and stores the values informed by the user. - It reads the file line by line. When the first word in a line matches with one of the hyper parameter's name (contained in hprnames, defined in the method of choice), it saves its value in the hprdata array.

ARGUMENTS

np_hprparams : integer The total number of hyper parameters possible for the optimization method.

size_hprdata : integer Size of hprdata second dimension (usually dimx, extended for generality).

hprnames : character*256, dim(nb_hprparams) Array of hyper parameter names/labels.

hprdata : real*8, dim(nb_hprparams, size_hprdata) Array of data (each hyperparameter value). Will have a lot of unused elements, since not all hyper parameters will have the same dimension. Each line is a different hyper parameter, in the same order as in hprnames.

hprdim : integer, dim(nb_hprparams) Dimension of each hyper parameter, again in order.

hprbool : logical, dim(nb_hprparams) Boolean array indicating which hyper parameters have been informed by the user (.true.) and which weren't (.false.).

requiredbool : logical, dim(nb_hprparams) Which hyper parameters are required (.true.) and which are optional (.false.). This argument is not used in this subroutine, but directly in check_hprparams, which is called directly at the end of this subroutine, but was separated solely for clarity.

Arguments

Type IntentOptional Attributes Name
integer :: nb_hprparams

The total number of hyper parameters possible for the optimization method.

integer :: size_hprdata

Size of hprdata second dimension (usually dimx, extended for generality).

character(len=256), dimension(nb_hprparams) :: hprnames

Array of hyper parameter names/labels.

real(kind=8), dimension(nb_hprparams, size_hprdata) :: hprdata

Array of data (each hyperparameter value). Will have a lot of unused elements, since not all hyper parameters will have the same dimension. Each line is a different hyper parameter, in the same order as in hprnames.

integer, dimension(nb_hprparams) :: hprdim

Dimension of each hyper parameter, again in order.

logical, dimension(nb_hprparams) :: hprbool

Boolean array indicating which hyper parameters have been informed by the user (.true.) and which weren't (.false.).

logical, dimension(nb_hprparams) :: requiredbool

Which hyper parameters are required (.true.) and which are optional (.false.). This argument is not used in this subroutine, but directly in check_hprparams, which is called directly at the end of this subroutine, but was separated solely for clarity.