!----------------------------------------------------------------------- !----------------------------------------------------------------------- !----------------------------------------------------------------------- ! Function tao_datum_name (datum, show_universe) result (datum_name) ! ! Function to return the datum name in the form: ! d2_name.d1_name[index] ! or (if show_universe is True and there is more than one universe): ! universe@d2_name.d1_name[index] ! For example: ! 2@orbit.x[23] ! ! ! Input: ! datum -- Tao_data_struct: Datum ! show_universe -- Logical, optional: Show the datum's universe. ! Default is True. ! ! Output: ! datum_name -- Character(60): Appropriate name. !- function tao_datum_name(datum, show_universe) result (datum_name) use tao_interface, dummy => tao_datum_name implicit none type (tao_data_struct) datum character(60) datum_name logical, optional :: show_universe ! If this datum is "isolated". That is, it does not have an associated d1_data ! structure then just use it's data_type. ! This can happen if the datum is derived from a curve. if (.not. associated(datum%d1)) then datum_name = datum%data_type return endif ! Normal case datum_name = tao_d2_d1_name (datum%d1, show_universe) write (datum_name, '(2a, i0, a)') trim(datum_name), '[', datum%ix_d1, ']' end function tao_datum_name