Versions Compared

Key

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

...

FAST is a two-dimensional model for wave propagation, long waves and mean flow, sediment transport and morphological changes of the nearshore area, beaches, dunes and backbarrier during stormstsunami calculations.

FAST Module Adapter

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 can be configured to use netcdf as output format generates output that is already readable by FEWS.

FAST pre-adapter

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

Class name: nl.deltares.FASTfast.FASTPreAdapterFastPreAdapter

Properties

No specific properties need to be configured for a model run.

There is however extra functionality provided via the properties but this is not needed if the model is setup correctly.
Configured properties starting with "PARAM_" will be added or replaced literally without "PARAM_" (and in lower case) in the params.txt file which defines the parameters for an FAST model run.
This functionality should only be used as a debug option and only by someone that understands the FAST properties in params.txt. To setup a model make sure you use a correctly configured params.txt so this functionality is not needed.

Notes for users

  • 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.log.
  • This program does not make use of a template file, parameters are automatically added and replaced in params.txt without the use of tags.
  • This program uses the information in the specified netcdf run file as input and uses this information to do the following actions:
    1. Create the water level input file: zs0file.txt
    2. Create the SWAN spectrum input files bcfile.txt and bc.timeXXX.sp2
    3. Replace or add the parameters 'tstart' and 'tstop' in params.txt

System requirements

Notes for users

  • 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:
    1. Replace the tag $WAVE_HEIGHT$ in template file (cil0_30mv3_TEMPLATE.xyz) with a wave height value from FEWS.

System requirements

  • This program needs Java version 1.7 or higher.
  • This program needs the following Java libraries:
    • castor-0.9.5.jar
    • commons-httpclient-3.0.1.jar
    • Delft_Util.jar
    • fews-
  • This program needs Java version 1.7 or higher.
  • This program 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

...

A complete example model run configuration file can be found here: FASTAdapterRunFastAdapterRun.xml Information how to prepare a FEWS environment to be able to use the FEWS model adapter can be found here: FAST FEWS setup

Start up activities

Start up activities

As a first activity it can be useful to delete all As a first activity it can be useful to delete all files present in the workDir, if for example it would be filled with files from a previous run.

...

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> 's will be a netcdf file (bcfile.nc) containing Swan wave spectra over time and a netcdf file (zs0file.nc) containing water level over time. 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 but properties can be configured as extra information. For example properties starting with "PARAM_" will be added or replaced literally without "PARAM_" (and in lower case) in the params.txt file which defines the parameters for an FAST model run. An example is given in the config below as <string key="PARAM_OUTPUTFORMAT" value="netcdf"/> this adds or replaces parameter 'outputformat' in params.txt and assigns the value 'netcdf'. All parameters should however be already correctly set in params.txt so these property should not be necessary..

Code Block
xml
xml
titleexport activities

		<exportActivities>
			<exportDataSetActivity>
				<moduleInstanceId>Run_FAST</moduleInstanceId>
Code Block
xmlxml
titleexport activities

		<exportActivities>
			<exportDataSetActivity>
				<moduleInstanceId>Run_FAST</moduleInstanceId>
			</exportDataSetActivity>
			<exportNetcdfActivity>
				<exportFile>bcfile.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_FAST</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>EnDens</parameterId>
						<domainParameterId>AFREQ</domainParameterId>
						<domainParameterId>NDIR</domainParameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour"/>
						<relativeViewPeriod unit="hour" start="-24" end="0"/>
						<readWriteMode>add originals</readWriteMode>
						<synchLevel>1</synchLevel>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportNetcdfActivity>exportDataSetActivity>
			<exportNetcdfActivity>
				<exportFile>zs0file<exportFile>wave_height.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_FAST</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>H_mean<<parameterId>WaveHeight</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="minute" multiplier="10"hour"/>
						<relativeViewPeriod unit="hour" start="-240" end="0"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportNetcdfActivity>
			<exportNetcdfRunFileActivity>
				<description>This run file is passed as argument to FASTPreAdapter<FastPreAdapter</description>
				<exportFile>run.nc</exportFile>
				<properties>
					<string key="PARAM_OUTPUTFORMAT" value="netcdf"/>
				</properties>
			</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 FASTfast_pre_adapter.log, which can be read into FEWS by coupling line patterns to FEWS log messages.
The second execute activity will be the module run. FAST generates different log files with different meaning, in the configuration below, all line from XBerror.txt are coupled to error messages in FEWS, all lines from XBwaring.txt are coupled to info messages in FEWS and all lines in XBlog.txt are coupled to debug messages in FEWS.

Code Block
xml
xml
titleexecute activities
		<executeActivities>
			                        <executeActivity>
				<command>
					<className>nl.deltares.FASTfast.FASTPreAdapter<FastPreAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
				<logFile>
					<file>FAST<file>d:\Data\FEWS_Issues\FEWS-11415_FAST_adapter\workDir\Fast_Pre_Adapter.log</file>
					<errorLinePattern>ERROR*</errorLinePattern>
					<warningLinePattern>WARN*</warningLinePattern>
					<infoLinePattern>INFO*</infoLinePattern>
					<debugLinePattern>DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
			</executeActivity>
			<executeActivity>
				<command></infoLinePattern>
					<executable>FAST.exe</executable><debugLinePattern>DEBUG*</debugLinePattern>
				</command>logFile>
				<logFile><timeOut>99999999</timeOut>
					<file>XBerror.txt</file>
		<ignoreDiagnostics>true</ignoreDiagnostics>
			<errorLinePattern>*</errorLinePattern>executeActivity>
				</logFile><executeActivity>
				<logFile><command>
					<file>XBwarning<executable>FASTrun.txt<exe</file>executable>
					<infoLinePattern>*</infoLinePattern>command>
				</logFile><arguments>
				<logFile>	<argument>cil0b2</argument>
					<file>XBlog.txt</file><argument>cil0_30mv3</argument>
					<debugLinePattern>*</debugLinePattern>arguments>
				<<timeOut>99999999</logFile>timeOut>
				<timeOut>99999999<<ignoreDiagnostics>true</timeOut>ignoreDiagnostics>
			</executeActivity>
		</executeActivities>

...