343
344
345
346
347
348
349
350
351
352 use dc_string, only: printf, tochar
353 use dc_trace, only: beginsub, endsub
355 implicit none
356 type(DC_SCALED_SEC), intent(in) :: sclsec
357 integer, intent(in), optional :: unit
358
359
360
361
362
363 character(*), intent(in), optional:: indent
364
365
366
367
368 integer :: out_unit, sec_ary_rev(imin:imax)
369 integer:: indent_len
370 character(STRING):: indent_str
371 character(1):: sign
372 character(*), parameter:: subname = 'DCScaledSecPutLine'
373 continue
374
375
376 if (present(unit)) then
377 out_unit = unit
378 else
380 end if
381
382 indent_len = 0
383 indent_str = ''
384 if ( present(indent) ) then
385 if ( len(indent) /= 0 ) then
386 indent_len = len(indent)
387 indent_str(1:indent_len) = indent
388 end if
389 end if
390
391 sec_ary_rev(imin:imax) = sclsec % sec_ary(imax:imin:-1)
392 if ( sclsec % flag_negative ) then
393 sign = '-'
394 else
395 sign = '+'
396 end if
397 if ( imax - imin + 1 == 6 ) then
398 call printf(out_unit, &
399 & indent_str(1:indent_len) // &
400 & '#<DC_SCALED_SEC:: @sign=%c @yotta=%d @exa=%d @tera=%d @mega=%d @base=%d @micro=%d>', &
401 & i = sec_ary_rev, c1 = sign )
402 elseif ( imax - imin + 1 == 11 ) then
403 call printf(out_unit, &
404 & indent_str(1:indent_len) // &
405 & '#<DC_SCALED_SEC:: @sign=%c @yotta=%d @zetta=%d @exa=%d @peta=%d @tera=%d', &
406 & i = sec_ary_rev(imin:imin+4), c1 = sign )
407 call printf(out_unit, &
408 & indent_str(1:indent_len) // &
409 & ' @giga=%d @mega=%d @kilo=%d @base=%d @milli=%d @micro=%d>', &
410 & i = sec_ary_rev(imax-5:imax) )
411 else
412 call printf(out_unit, &
413 & indent_str(1:indent_len) // &
414 & '#<DC_SCALED_SEC:: @sign=%c @sec_ary=%*d>', &
415 & i = sec_ary_rev, n = (/ imax - imin + 1 /), c1 = sign )
416 end if
417 999 continue
418
Provides kind type parameter values.
integer, parameter, public stdout
Unit number for Standard OUTPUT
integer, parameter, public string
Character length for string