function plt(args)
ca=subwrd(args,1)
if (ca='') ; ca='kv' ; endif
cb=subwrd(args,2)
if (cb='') ; cb='rb' ; endif
atm=subwrd(args,3)
if (atm='') ; atm='ht' ; endif
caso=subwrd(args,4)
if (caso='') ; caso='ERA_5' ; endif
date=subwrd(args,5)
if (date='') ; date='2023020100' ; endif
casestudy='SaoSebClm'

ma=0
mb=1
var=ca''cb''ma''mb

if (atm='ht') ; pfa=450 ; pfb=100 ; kfa=17 ; kfb=27 ; endif
if (atm='ct') ; pfa=700 ; pfb=300 ; kfa=12 ; kfb=20 ; endif
if (atm='bt') ; pfa=1000 ; pfb=550 ; kfa=1 ; kfb=15 ; endif

'reinit'
dir='/pesq/dados/bamc/paulo.bonatti/Modal_Energetics/Version_3.0/Interaction_Horizontal_Vertical/dataout/'
filea='INHV'caso''date''date'P.icn.RB0125L037.ctl'
'open 'dir''filea

'query time'
dg=subwrd(result,3)
dateg=substr(dg,6,7)

'set display color white'
'clear'

'set grads off'
'set mpdset brmap_mres'
'set map 1 1 3'
'set lev 200'
'set lat -90 0'
'set xlopts 1 8 0.15'
'set ylopts 1 8 0.15'
'set clopts 1 8 0.12'
'set cthick 8'
'define ea=sum(e'var'.1,z='kfa',z='kfb')/1000'
'display ea'
pa=subwrd(result,2)
pb=subwrd(result,4)
dp=subwrd(result,6)
ct='Contours: 'pa' to 'pb' by 'dp' [kJ/kg]'
ha=9746.3
hb=641.4
za=00
zb=04
hc=434.5
hd=125.1
zc=05
zd=10
tr='Monthly Mean 'dateg'  Case Study: 'casestudy'  RB0125L037'
'draw title `1'caso' Hor-Ver Energy Interaction 'ca'_C'ma'_'cb'_C'mb' - Levels: 'pfa'-'pfb' hPa\`1C'ma': H'za'='ha' to H'zb'='hb' - C'mb': H'zc'='hc' to H'zd'='hd'\`1'tr
'draw xlab `1'ct

fig='../png/Energy_Interaction_Total_'ca'_C'ma'_'cb'_C'mb'_'pfa'_'pfb'_hPa_'caso'_'casestudy'_'dateg'_HS_RB0125L037.png'
say ' '
say ' fig = 'fig
say ' '
'printim 'fig' png white'

return
