ovarin Subroutine

public subroutine ovarin(file, descr, varnam, value, output_flag)

Routine to print out the details of an integer variable author: P J Knight, CCFE, Culham Science Centre file : input integer : Fortran output unit identifier descr : input character string : Description of the variable varnam : input character string : Name of the variable value : input integer : Value of the variable output_flag : optional character This routine writes out the description, name and value of an integer variable. !

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: file
character(len=*), intent(in) :: descr
character(len=*), intent(in) :: varnam
integer, intent(in) :: value
character(len=3), intent(in), optional :: output_flag

Contents

Source Code


Source Code

  subroutine ovarin(file,descr,varnam,value,output_flag)

    !! Routine to print out the details of an integer variable
    !! author: P J Knight, CCFE, Culham Science Centre
    !! file : input integer : Fortran output unit identifier
    !! descr : input character string : Description of the variable
    !! varnam : input character string : Name of the variable
    !! value : input integer : Value of the variable
    !! output_flag : optional character
    !! This routine writes out the description, name and value of an
    !! integer variable.
    !!     !
    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    use numerics, only: name_xc, icc, ioptimz
		use global_variables, only: xlabel_2, iscan_global
		use constants, only: mfile, nout
		use maths_library, only: variable_error
    implicit none

    !  Arguments

    integer, intent(in) :: file
    character(len=*), intent(in) :: descr, varnam
    integer, intent(in) :: value
    character(len=3), intent(in), optional :: output_flag

    !  Local variables

    character(len=72) :: dum72
    character(len=30) :: dum20
    character(len=20) :: stripped
    character(len=3) :: flag

    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    !  Replace descr and varnam with dummy strings of the correct length.
    !  This counters problems that would occur if the two original strings
    !  were the wrong length.

    dum72 = descr
    dum20 = varnam
    stripped = varnam(2:len(varnam)-1)
    if (present(output_flag)) then
        flag = output_flag
    else
        flag = ''
    end if

    if (any(name_xc == stripped))  flag = 'ITV'

    if (file /= mfile) then
       ! MDK add ITV label if it is an iteration variable
       ! The ITV flag overwrites the output_flag
       write(file,20) dum72, dum20, value, flag
    end if

    call underscore(dum72)
    call underscore(dum20)
    write(mfile,10) dum72, dum20, value, flag

10  format(1x,a,t75,a,t110,i10," ",a,t10)
20  format(1x,a,t75,a,t100,i10,t112, a)

  end subroutine ovarin