A Meteorological Application - World Weather

Movie Scenarios Become Realities?

Giant tidal waves drowning New York City, tennis ball size hailstones bombing Tokyo, the entire northern hemisphere turning into the new ice age, these are the catastrophic scenarios in the movie ˇ§The day after tomorrowˇ¨. However, as global temperatures continue to rise due to the greenhouse effect, will these film scenarios become reality? Is there a way to prevent them from happening? If not, how do we reduce the impact of natural hazards so they do not turn into disasters? Perhaps no one knows the exact side effect that civilization may bring us, but climate changes have certainly concerned people with the future state of our planet, which leads to a great challenge for meteorologists.

 

Prevention and Preparedness for Natural Hazards

With continuous global warming making weather unpredictable, weather forecasters are compelled to put emphasis on efficiency and accuracy, in order to mitigate the risk of natural hazards. In addition to well-facilitated observation equipments, simulation applications are also indispensable for handling meteorological data. Nevertheless, existing application suits often provide limited or redundant capabilities. To be more practical, some researchers choose to write their own applications to fulfill their needs. However, available tools today are not designed to ease software maintainability; writing UI for the application with these tools could result in extra time wasted on code maintenance. The introduction of MATFOR 4 solves this quandary by providing functions for UI creation and implementation, eliminating the time and effort spent on writing small widgets for applications.


MATFOR 4 GUI Example: Simulation of World Weather
(Data courtesy of Dr. Tseng Chien-Han, Department of Meteorology, Central Weather Bureau of Taiwan)

MATFOR 4 also features Cartographic Projection. It mathematically displays the curved surface of the earth onto numerous two-dimensional graphs. Users may use embedded MATFOR functions to create geoid and coastline data for mesh plots prior to the projection. The following example is courtesy of researchers from Central Weather Bureau of Taiwan; users may choose to simulate global climates using different Data Sets, Draw Methods and Mappings.

 

Data Set: T
Draw Method: Contour
Mapping: Transverse Cylinder Equal

Data Set: Q
Draw Method: PColor
Mapping: Transverse Cylinder Equal

Data Set: U
Draw Method: PColor
Mapping: Lamber Conformal Conic

Data Set: V
Draw Method: Quiver + Contour
Mapping: Global
Try MATFOR

Building an Application using MATFOR 4

By integrating UI files with MATFOR libraries, MATFOR GUI System packages complex codes to facilitate application building. With the new MATFOR GUI builder that allows drag-and-drop manipulations and automatically generates source code templates, MATFOR 4 presents an unprecedented ease of UI programming to Fortran and C++ programmers. The diagram below shows the workflow of a basic MATFOR GUI system. The program starts by initializing UI components, follows with callback registration in which handles are set to their respective callback functions. As the program enters the main loop, the UI Engine starts event monitoring. When a mouse event occurs, the UI engine triggers the callback function and proceeds calculation and simulation.

 


MATFOR 4 GUI Example: A Rundown on the Source Code

Step 1
Implement subroutines in RDC_core.f90 using MATFOR functions. Use the embedded data-manipulation functions to create 3D geoid data and coastline data and further to perform cartographic projection.

Step 2
Use MATFOR GUI Builder to create a new interface. Give names and create handles for all UI objects used, then save the interface into an MFUI file (RDC.mfui). A source file (RDC.f90) with function template should also be generated automatically.

Step 3
After creating the new project, go over to the source file (RDC.f90) and define the resulting actions for each handler. As a defined event occurs, the code in these functions is triggered. The example below shows the implementation of an event handling for a button click. When the user clicks on ˇ§Animateˇ¨ button on the screen, the button fires an action event. Since the name of the button, btnAnimate, is registered to use handler btnAnimate_Click, this function is called every time the button is clicked.

(RDC.f90)
!///////////////////////////////////////////////////////////////////////////////
!// MxUI Callback BEGIN
subroutine btnAnimate_Click(sender)
ˇK
// Actions performed
// Enter your code here

end subroutine btnAnimate_Click
ˇK
!// MxUI Callback END
!///////////////////////////////////////////////////////////////////////////////

!///////////////////////////////////////////////////////////////////////////////
!// Set UI Callbacks
subroutine msSetUICallbacks
ˇK
call msUISetOnClick( 'btnAnimate', btnAnimate_Click )
ˇK
end subroutine msSetUICallbacks
!// msSetUICallbacks END
!///////////////////////////////////////////////////////////////////////////////

Go Back Home

Complete source code files are available upon the installation of MATFOR 4. Download it now to create your own application! Or contact sales@ancad.com for more information.