Routine to print out the details of a floating-point
variable using 'F' format
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 real : Value of the variable
output_flag : optional character
This routine writes out the description, name and value of a
double precision variable in F format (e.g.
-12345.000
).
!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | file | |||
character(len=*), | intent(in) | :: | descr | |||
character(len=*), | intent(in) | :: | varnam | |||
real(kind=8), | intent(in) | :: | value | |||
character(len=3), | intent(in), | optional | :: | output_flag |
subroutine ovarrf(file,descr,varnam,value,output_flag)
!! Routine to print out the details of a floating-point
!! variable using 'F' format
!! 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 real : Value of the variable
!! output_flag : optional character
!! This routine writes out the description, name and value of a
!! double precision variable in F format (e.g.
!! <CODE>-12345.000</CODE>).
!! !
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
use numerics, only: name_xc
use global_variables, only: verbose
use constants, only: pi, mfile, nplot, electron_charge
implicit none
! Arguments
integer, intent(in) :: file
character(len=*), intent(in) :: descr, varnam
real(8), intent(in) :: value
character(len=3), intent(in), optional :: output_flag
! Local variables
character(len=72) :: dum72
character(len=20) :: 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 label if it is an iteration variable
! The ITV flag overwrites the output_flag
if (verbose==1) then
write(file,10) dum72, dum20, value, flag
else
write(file,20) dum72, dum20, value, flag
end if
end if
10 format(1x,a,t75,a,t100,f13.6, t115, a)
20 format(1x,a,t75,a,t100,f10.3, t112, a)
call ovarre(mfile,descr,varnam,value)
end subroutine ovarrf