%	report.s
%
%	Purpose:	HTML report generation
%	Copyright:	R.A. van Engelen, Leiden University, 1998

include html, fort77, sfun, disclaim.

%	Sky logo (a little bit cumbersome, should be improved!)

report_sky_logo := html_image("sky.gif").

%	Define nice bullet for itemize

report_bullet := html_image("redball.gif").

%	Create a LaTeX image

report_latex(Label) := html_label_latex(Label, $LaTeX("\mbox{\LaTeX}")).

%	Allow 132 character wide HTML and 150 `character' wide LaTeX expressions

report_html_width := 80.
report_latex_width := 150.

%	The report generator itself:

report := proc(( html_width ` set(report_html_width)
; html_document("report", "Ctadel Report", [ report_variable_class(label1,
"Independent Variables", independent_var)
, report_variable_class(label2,
"Index Variables", index_var)
, report_variable_class(label3,
"Fundamental Variables", fundamental_var)
, report_variable_class(label4,
"Temporary Variables", temporary_var)
, report_variable_class(label5,
"Derived Variables", derived_var)
, html_h1("Ctadel")
,
"This page is under construction."
, html_p
,
"Purpose of this page is to demonstrate the result of Ctadel's code generation for the HIRLAM dynamics."
,
"The HIRLAM dynamics is one of the core numerical routines used in the HIRLAM weather forecast system."
, html_p
,
"Ctadel's algebraic environment integrates HTML and"
, report_latex(latex_label)
, html_image(latex_label)
,
"document generation capabilities."
, "This allows"
, report_big
,
"mathematical expressions to be integrated in HTML pages."
, html_p
,
"You can simply navigate through the object-oriented core of Ctadel by clicking on any"
, object
,
"that is highlighted."
, html_p
,
"All the documents that you can access from here are automatically"
, html_ref(
"report.s.html", "generated")
,
"from the source scripts below."
, html_p
, html_h3(
"Source scripts used in the translation process")
, report_scripts
, "The"
, html_tt("dyn.s")
,
"script contains the equations governing the atmosphere."
, html_h3(
"Additional information on the classes of variables")
, html_itemize(report_bullet,
[ html_ref(label1, "Independent")
, html_ref(label2, "Index")
, html_ref(label3, "Fundamental")
, html_ref(label4, "Temporary")
, html_ref(label5, "Derived") ])
, html_h3(
"Code generated")
, report_code
, html_p
, html_font([ "size" = -1
, "face" =
"arial" ], [ "This document was generated by a Ctadel"
, html_ref("report.s.html", "HTML report generator.") ]) ])
; latex_math ` switch(on)
; foreach (file in script ` get_sources do
(html_prolog_file(file); latex_prolog_file(file))
)
; latex_math ` switch(off)
; return nil
)).
% Procedures used by the report generator: report_big := proc([ html_subdocument(_G2642, "Big Expression", [
"The non-factorized Gegenbauer Polynomial"
, html_latex_math({cln(x, 7, 11)})
, "expands into"
, html_latex_math(report_latex_width, cln(x, 7, 11))
, html_p
,
"Ctadel's algebraic factorization yields"
, html_latex_math(report_latex_width, x * (( x ^ 2
* ( ( x ^ 2
* ( ( x ^ 2
* ( ( x ^ 2
* ( 25346048 * x ^ 2
- 41000960
)
)
+ 23063040
)
)
- 5381376
)
)
+ 480480
)
) - 11088)) ])
, html_ref(_G2642, "big") ]).
report_scripts := proc(html_itemize(report_bullet, report_script(script ` get_sources))). (report_script(File) :=
[ html_ref(File // ".ps", html_tt(File))
, html_ref(File // ".html", "[HTML]") ])
.
report_code := proc([ "Examples of the automatically generated Fortran codes:"
, html_subdocument(_G2534, "Serial", html_fortran(serial_code))
, html_subdocument(_G2549, "Data Parallel", html_fortran(datapar_code))
, html_subdocument(_G2561, "HPF", html_hpf(serial_code))
, html_itemize(report_bullet, [ html_ref(_G2534, "Serial")
, html_ref(_G2549,
"Data Parallel")
, html_ref(_G2561, "HPF") ])
,
"NOTE: These codes are intended for illustrative purposes. The fully optimized codes are not made publicly available."
, html_p
, disclaimer(_G2643)
, "We provide no warranty, please see the"
, html_ref(_G2643, "disclaimer")
, "for more details." ]).
(report_variable_class(Label, Title, Class) :=
html_subdocument(Label, Title, [ html_h3(Title)
, report_variable_class(Class) ]))
.
(report_variable_class(Class) :=
html_itemize(click_variable(Class ` get_instances)))
.
(click_variable(Name) :=
[ html_it(Name)
, report_variable(_G2516, _G2517, Name)
, html_ref(_G2516, "[LaTeX]")
, html_ref(_G2517, "[HTML]") ])
.
(report_variable(Label1, Label2, Name) :=
[ html_subdocument(Label1, sprint(Name), html_latex_math(report_latex_width, report_variable(Name)))
, html_subdocument(Label2, sprint(Name), html_b(html_pre(report_variable(Name)))) ])
.
(report_variable(Name) :=
[ get_declaration(Name)
, html_description([ "Scalar Form" = retrieve(Name, scalar_value)
, "Dimensioned" = retrieve(Name, dimensioned_value)
, "Discretized" = retrieve(Name, discrete_value)
, "CSE Eliminated" = retrieve(Name, cse_value) ]) ])
.