# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2026, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------

# title
#amk
if exid[1] = exid[2] then
  title_txt_1 = "Zonal Mean "&statistic&" "&param[iparam]
else
  title_txt_1 = "Difference: Zonal Mean "&statistic&" "&param[iparam]&" (n="&ndates&")"
end if

title_txt_2 = ""
#title_txt_3 = "Dates: "&date_list_exp[1]&", ... , "&date_list_exp[count(date_list_exp)]&" (M+"&fc_steps[1]&"-M+"&fc_steps[count(fc_steps)]&")"
title_txt_3 = ndates&" Dates: "&inidate&", ...   Averaging Period Start: "&yymm_start&"  Length: "&mm_len&" Months"

if exp_mode[2] = "RD_SEAS" then
#xmk  title_txt_2 = title_txt_2&"RD Seasonal Forecast (System "&system&" "&exid[2]&") - "
  title_txt_2 = title_txt_2&"Climate Forecast ("&exid[2]&")"
else
  title_txt_2 = title_txt_2&"OD Seasonal Forecast (System "&system&""
end if

if exid[1] <> exid[2] then
  if exp_mode[1] = "ERA40" then
    title_txt_2 = title_txt_2&" - "&ERATEXT
  else
#xmktitle_txt_2 = title_txt_2&" - Analysis"
    title_txt_2 = title_txt_2&" - ("&exid[1]&")"
  end if
end if

title = ptext(
        TEXT_AUTOMATIC           :  'NO',
        TEXT_USER                :  'YES',
        TEXT_COLOUR              :  'BLACK',
        TEXT_QUALITY             :  'HIGH',
        TEXT_LINE_1              :  title_txt_1,
        TEXT_LINE_2              :  title_txt_2,
        TEXT_LINE_3              :  title_txt_3,
        TEXT_JUSTIFICATION       :  'LEFT',
        legend_text_maximum_height      : 0.8,
        legend_text_quality             : "HIGH",
        text_reference_character_height : 0.8,
        legend_text_colour	:	"black",
        TEXT_LINE_COUNT          :  3
        )
