Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


...

Table of Contents

FAST

FAST is a two-dimensional model for tsunami calculations.

...

This page describes the FAST module adapter, its functions, and provides an example for configuring a FAST run in FEWS.
It only has a pre adapter since FAST generates output that is already readable by FEWS.

FAST

...

adapter

Model pre- adapter for running a FAST model from Delft-FEWS.

Class namenames:

nl.deltares.fast.FastPreAdapter
nl.deltares.fast.FastPostAdapter

Notes for users

FastPreAdapter

  • For all files that are written by this adapter, if the file to be written already exists, then it will be overwritten.
  • This program writes log messages to a log file called Fast_Pre_Adapter.log.
  • This program uses the information in the specified netcdf run file as input and uses this information to do the following:
  • Replace the tag $WAVE_HEIGHT$ in template file (cil0_30mv3_TEMPLATE.xyz) with a wave height value from the exported netcdf file from FEWS.

FastPostAdapter

  • For all files that are written by this adapter, if the file to be written already exists, then it will be overwritten.
  • This program writes log messages to log file called Fast_Post_Adapter.log.
  • Converts model output (cil0_30mv3_out.asc) in esri grid format to fews netcdf grid format for T0.

System requirements

  • The model needs Matlab Compiler runtime 2013b x64 v8.2 to be installed
  • The adapter This program needs Java version 1.7 or higher.
  • This program The adapter needs the following Java libraries:
    • castor-0.9.5.jar
    • commons-httpclient-3.0.1.jar
    • Delft_Util.jar
    • fews-FAST-adapter.jar
    • log4j-1.2.14.jar
    • netcdf-4.2.jar
    • slf4j-api-1.5.6.jar
    • slf4j-log4j12-1.5.6.jar
    • xercesImpl.jar

...

Code Block
xml
xml
titlestart up activities

		<startUpActivities>
			<purgeActivity>
				<filter>workDir*</filter>
			</purgeActivity>
		</startUpActivities>

...

The first steps in the general adapter run are the data set, netcdf and run file export activities. The <exportDataSetActivity> will extract a zip file with the module instance id as file name located in "Config\ModuleDataSetFiles\" of the FEWS environment to the workdir. The <exportNetcdfActivity> will be a netcdf file which can have any name containing a variable called wave_height which has exactly one value. The <exportNetcdfRunFileActivity> will be a netcdf run file that contains information needed by the pre adapter. The information will be automatically filled by the general adapter.

Code Block
xml
xml
titleexport activities

		<exportActivities>
			<exportDataSetActivity>
				<moduleInstanceId>Run_FAST</moduleInstanceId>
			</exportDataSetActivity>
			<exportNetcdfActivity>
				<exportFile>wave_height.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_FAST</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>WaveHeight</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour"/>
						<relativeViewPeriod unit="hour" start="0" end="0"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportNetcdfActivity>
			<exportNetcdfRunFileActivity>
				<description>This run file is passed as argument to FastPreAdapter</description>
				<exportFile>run.nc</exportFile>
			</exportNetcdfRunFileActivity>
		</exportActivities>

...

The next steps are the execute activities.
The first will be the pre adapter. This program will read the run.nc input file and use the contents for instructions on which directory and files should be used to convert to the correct FAST input format. The Pre adapter generates a log file called fast_pre_adapter.log, which can be read into FEWS by coupling line patterns to FEWS log messages.
The second
The second execute activity will be the module run.
The third execute activity will be the module runpost adapter.

Code Block
xml
xml
titleexecute activities

		<executeActivities>
                        <executeActivity>
				<command>
					<className>nl.deltares.fast.FastPreAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
				<logFile>
					<file>Fast_Pre_Adapter.log</file>
					<errorLinePattern>ERROR*</errorLinePattern>
					<warningLinePattern>WARN*</warningLinePattern>
					<infoLinePattern>INFO*</infoLinePattern>
					<debugLinePattern>DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>		
			<executeActivity>
				<command>
					<executable>FASTrun.exe</executable>
				</command>
				<arguments>
					<argument>cil0b2</argument>
					<argument>cil0_30mv3</argument>
				</arguments>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
			<executeActivity>
				<command>
					<className>nl.deltares.fast.FastPostAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</executeActivities>

Wave height input file

arguments>
				<logFile>
					<file>Fast_Post_Adapter.log</file>
					<errorLinePattern>ERROR*</errorLinePattern>
					<warningLinePattern>WARN*</warningLinePattern>
					<infoLinePattern>INFO*</infoLinePattern>
					<debugLinePattern>DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
		</executeActivities>

Executing pre adapter

This program will read the run.nc input file and use the contents for instructions on which directory and files should be used to convert to the correct FAST input format.
The Pre adapter generates a log file called fast_pre_adapter.log, which can be read into FEWS by coupling line patterns to FEWS log messages.
It uses the exported netcdf file to look for the latest non missing value of the wave height to write Th exported netcdf file with the wave height will be used to write the wave height to cil0_30mv3.xyz by replacing the tag &WAVE$WAVE_HEIGHT& HEIGHT$ in cil0_30mv3_TEMPLATE.xyz:

Code Block
none
none
titlecil0_30mv3_TEMPLATE.xyz

108.34958333  -7.83289859   $WAVE_HEIGHT$    900 1
108.35411600  -7.83289136   $WAVE_HEIGHT$    900 1
108.35859257  -7.83344007   $WAVE_HEIGHT$    900 1
108.36302258  -7.83258101   $WAVE_HEIGHT$    900 1
108.36729527  -7.83112279   $WAVE_HEIGHT$    900 1
108.37134559  -7.82910962   $WAVE_HEIGHT$    900 1
108.37528703  -7.82689069   $WAVE_HEIGHT$    900 1
108.37936617  -7.82496548   $WAVE_HEIGHT$    900 1
108.38335489  -7.82662508   $WAVE_HEIGHT$    900 1
108.38745431  -7.82846972   $WAVE_HEIGHT$    900 1

By replacing $WAVE_HEIGHT$ with value 5 cil0_30mv3.xyz will be:

Code Block
none
none
titlecil0_30mv3.xyz

108.34958333  -7.83289859   5.00    900 1
108.35411600  -7.83289136   5.00    900 1
108.35859257  -7.83344007   5.00    900 1
108.36302258  -7.83258101   5.00    900 1
108.36729527  -7.83112279   5.00    900 1
108.37134559  -7.82910962   5.00    900 1
108.37528703  -7.82689069   5.00    900 1
108.37936617  -7.82496548   5.00    900 1
108.38335489  -7.82662508   5.00    900 1
108.38745431  -7.82846972   5.00    900 1

Executing model run

The next activity will be executing the FAST model run. This is done by running This activity runs the model (FASTrun.exe) in the workdir containing the model files with the input file names as arguments. The model creates the output file cil0_30mv3_out.asc which contains the grid information for FEWS.

Code Block
xml
xml
titlemodule run execute activity
			
			<executeActivity>
				<command>
					<executable>FASTrun.exe</executable>
				</command>
				<arguments>
					<argument>cil0b2</argument>
					<argument>cil0_30mv3</argument>
				</arguments>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>

...

Executing post adapter

The last part of the general adapter run is importing the FAST output. post adapter converts model output (cil0_30mv3_out.asc contains the output ) in esri grid format to fews netcdf grid format for T0. The name of the netcdf file will be the name configured for the netcdf import activity which is stored in the netcdf run file.
The post adapter writes log messages to log file called Fast_Post_Adapter.log which can be read into FEWS by coupling line patterns to FEWS log messages.

Code Block
xml
xml
titlemodel run output import post adapter execute activity
			<executeActivity>
		<importActivities>		<command>
					<className>nl.deltares.fast.FastPostAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
			<importCustomFormatTimeSeriesActivity>	<logFile>
					<importFile>cil0<file>Fast_30mv3Post_out.asc</importFile>Adapter.log</file>
					<errorLinePattern>ERROR*</errorLinePattern>
					<warningLinePattern>WARN*</warningLinePattern>
					<infoLinePattern>INFO*</infoLinePattern>
					<debugLinePattern>DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>

Importing post adapter output

The last part of the general adapter run is importing the post adapter output.

Code Block
xml
xml
titlemodel run output import activity
		<importActivities>
			<importNetcdfActivity>
				<importFile>postAdapterOutput.nc</importFile><parserClassName>nl.wldelft.fews.pi.EsriAsciiGridParser</parserClassName>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>H_mean<max</parameterId>
						<locationId>Fast</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="nonequidistant"/>
						<readWriteMode>read complete forecast</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importCustomFormatTimeSeriesActivity>importNetcdfActivity>
		</importActivities>