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 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

...

adapter

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

Class namenames:

nl.deltares.FASTfast.FASTPreAdapter

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.

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 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 a log file called FASTFast_Post_Adapter.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

  • 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 needs Java version 1.7 or higher.
  • The adapter needs the following Java libraries:
    • castor-0.9.5.jar
    • commons-
  • 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 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.

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> 's will be a netcdf file (bcfile.nc) containing Swan wave spectra over time and a netcdf file (zs0file.nc) containing water level over timewhich can have any name containing a variable called wave_height. 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>
			</exportDataSetActivity>
			<exportNetcdfActivity>
				<exportFile>wave_height.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
			
Code Block
xmlxml
titleexport activities

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

Execute activities

The next steps are the execute activities.
The first will be the pre adapter.
The second execute activity will be the module run.
The third execute activity will be the post adapter.

Code Block
xml
xml
titleexecute activities
		<executeActivities>
                        <executeActivity>
				<command>="0"/>
						<readWriteMode>add originals</readWriteMode>
						<synchLevel>1</synchLevel><className>nl.deltares.fast.FastPreAdapter</className>
					<<binDir>adapter\bin</timeSeriesSet>binDir>
				</timeSeriesSets>command>
				</exportNetcdfActivity><arguments>
			<exportNetcdfActivity>
				<exportFile>zs0file<argument>run.nc</exportFile>argument>
				<timeSeriesSets></arguments>
					<timeSeriesSet><logFile>
						<moduleInstanceId>Run_FAST</moduleInstanceId><file>Fast_Pre_Adapter.log</file>
						<valueType>scalar</valueType><errorLinePattern>ERROR*</errorLinePattern>
						<parameterId>H_mean</parameterId><warningLinePattern>WARN*</warningLinePattern>
						<locationId>Dummy</locationId><infoLinePattern>INFO*</infoLinePattern>
						<timeSeriesType>external historical</timeSeriesType><debugLinePattern>DEBUG*</debugLinePattern>
						<timeStep unit="minute" multiplier="10"/></logFile>
						<relativeViewPeriod unit="hour" start="-24" end="0"/><timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>		
			<executeActivity>
				<readWriteMode>add originals</readWriteMode><command>
					<<executable>FASTrun.exe</timeSeriesSet>executable>
				</timeSeriesSets>command>
				</exportNetcdfActivity><arguments>
					<exportNetcdfRunFileActivity><argument>cil0b2</argument>
				<description>This run file is passed as argument to FASTPreAdapter</description>	<argument>cil0_30mv3</argument>
				<exportFile>run.nc<</exportFile>arguments>
				<properties><timeOut>99999999</timeOut>
					<string key="PARAM_OUTPUTFORMAT" value="netcdf"/><ignoreDiagnostics>true</ignoreDiagnostics>
				</properties>executeActivity>
			</exportNetcdfRunFileActivity><executeActivity>
				</exportActivities>

Execute activities

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.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.

...


		<executeActivities>
			<executeActivity>
				<command>
					<className>nl.deltares.FAST.FASTPreAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
				<logFile>
					<file>FAST.log</file>
					<errorLinePattern>ERROR*</errorLinePattern>
					<warningLinePattern>WARN*</warningLinePattern>
					<infoLinePattern>INFO*</infoLinePattern>
					<debugLinePattern>DEBUG*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
			</executeActivity>
			<executeActivity>
				<command>
					<executable>FAST.exe</executable>
				</command>
				<logFile>
					<file>XBerror.txt</file>
					<errorLinePattern>*</errorLinePattern>
				</logFile>
				<logFile>
					<file>XBwarning.txt</file>
					<infoLinePattern>*</infoLinePattern>
				</logFile>
				<logFile>
					<file>XBlog.txt</file>
					<debugLinePattern>*</debugLinePattern>
				</logFile>
				<timeOut>99999999</timeOut>
			</executeActivity>
		</executeActivities>

Wave spectrum conversion

"bcfile.nc" will be used to write the wave spectra into the following format:

  • bcfile.txt referencing to wave spectrum files and a time of how long these should be used in each calculation step

...


FILELIST
3600.0      1.0 bc.time001.sp2
3600.0      1.0 bc.time002.sp2
3600.0      1.0 bc.time003.sp2
3600.0      1.0 bc.time004.sp2
3600.0      1.0 bc.time005.sp2
3600.0      1.0 bc.time006.sp2
3600.0      1.0 bc.time007.sp2
3600.0      1.0 bc.time008.sp2
3600.0      1.0 bc.time009.sp2
3600.0      1.0 bc.time010.sp2
  • bc.time001.sp2 containing a wave spectrum

...


SWAN   1                                Swan standard spectral file, version
$   Data exported by FEWS for SWAN
$   Project:                 ;  run number:
TIME                                    time-dependent data
     1                                  time coding option
LONLAT                                  locations in spherical coordinates
     1                                  number of locations
   4.6019540   52.6194688
AFREQ                                   1/s
    25                                  number of frequencies
    0.0500
    0.0566
    0.0642
   ...
    0.7791
    0.8827
    1.0000
NDIR                                    degrees
    36                                  number of directions
  265.0000
  255.0000
  245.0000
  ...
  -65.0000
  -75.0000
  -85.0000
QUANT
     1                                  number of quantities in table
EnDens                                  id
m                                       unit
   -0.9900E+02                          exception value
20010101.000000                         date and time
FACTOR
    0.0011500214
     0     0     0     0     0     0     0     0     0     0     ...     0     0     0
     0     0     0     0     0     0     0     0     0     0     ...     0     0     0
     0     0     0     0     0     0     0     0     0     0     ...     0     0     0
     1     1     0     0     0     0     0     0     0     0     ...     0     0     1
    40    27     9     3     3     3     2     0     0     0     ...     2     9    28
   610   294    70    17    24    31    17     0     0     0     ...    67   303   626
  4916  1621   268    57   119   193   145    23     0     1     ...  1780  5295  7229
 13782  3341   415    94   287   659   803   340     0     6     ... 14433 28039 27099
 14186  2446   257    68   290   982  1874  1407     5     3     ... 52381 62127 39577
 10369  1638   231    37    90   431  1241  1598   227     0     ... 99999 80353 37089
  8225  1923   361    54    17    70   324   770   448     0     ... 77305 54223 24535
  6742  1962   381    88    21     6    30   143   211     0     ... 42814 28100 15442
  5744  2480   622   147    34     5     1     8    30     0     ... 27283 16631  9808
  4448  2618  1011   228    41     6     0     0     2     2     ... 15103  9139  6001
  2853  2150   977   217    34     5     1     0     0     0     ...  8682  5250  3507
  1818  1588   752   160    20     4     1     0     0     0     ...  4838  2895  2116
  1064   927   597   168    23     3     0     0     0     0     ...  2374  1383  1151
   517   534   423   142    23     2     0     0     0     0     ...  1182   789   561
   243   299   202    87    17     1     0     0     0     0     ...   756   329   262
   137   112    87    51    12     1     0     0     0     0     ...   243    98   120
    86    40    34    18     5     1     0     0     0     0     ...   137   117   142
    55    21     8     4     2     0     0     0     0     0     ...   137   123    87
    24    13     3     1     0     0     0     0     0     0     ...    83    74    62
     6     7     1     0     0     0     0     0     0     0     ...    58    27    16
     6     3     0     0     0     0     0     0     0     0     ...    39    20    10

Water level conversion

In this example "zs0file.nc" will be used to write the time dependent water levels to a file named "zs0file.txt". The first column specifies the time (meaning defined in "PARAM_TUNITS") and the second column water level. For now the adapter only supports the water level as a single boundary condition but FAST has to possibility to also use 2 or 4 resulting in 1 or 3 extra columns.

...


0.0000000e+000 -2.2000000e-002
6.0000000e+002  2.2000000e-002
1.2000000e+003  6.4999998e-002
1.8000000e+003  1.0800000e-001
2.4000000e+003  1.5200000e-001
3.0000000e+003  1.9400001e-001
3.6000000e+003  2.3700000e-001
4.2000000e+003  2.7900001e-001
4.8000000e+003  3.1999999e-001
5.4000000e+003  3.6100000e-001
6.0000000e+003  4.0099999e-001
6.6000000e+003  4.4100001e-001
7.2000000e+003  4.7900000e-001
7.8000000e+003  5.1700002e-001
8.4000000e+003  5.5400002e-001
9.0000000e+003  5.8999997e-001
9.6000000e+003  6.2400001e-001
1.0200000e+004  6.5700001e-001
1.0800000e+004  6.9000000e-001
1.1400000e+004  7.2000003e-001
1.2000000e+004  7.5000000e-001
1.2600000e+004  7.7800000e-001
1.3200000e+004  8.0500001e-001
1.3800000e+004  8.2999998e-001
1.4400000e+004  8.5299999e-001
1.5000000e+004  8.7500000e-001
1.5600000e+004  8.9499998e-001
1.6200000e+004  9.1399997e-001
1.6800000e+004  9.3000001e-001
1.7400000e+004  9.4599998e-001
1.8000000e+004  9.5899999e-001

Parameter conversion

It is possible to change model parameters as defined in params.txt from FEWS. The pre adapter will convert all run file properties starting with "PARAM_" to FAST parameters in "params.txt". Example: params.txt.
It reads the existing "params.txt" and searches for a line starting with the specified parameter and replaces the whole line with "parameter = value" or adds a new line in the same format when the parameter was not present yet.

...


----------------------------------------------------
Grid input
nx       = 154
ny       = 70
xfile    = x.grd
yfile    = y.grd
xori     = 101627.84
yori     = 513562.63
depfile  = egmondFAST.dep
----------------------------------------------------
Numerics input
CFL      = 0.8
eps      = 0.01
----------------------------------------------------
Time input
tstart   = 0.
tstop = 36000
----------------------------------------------------
General constants
rho      = 1025
g        = 9.81
----------------------------------------------------
Boundary condition options
zs0file  = zs0file.txt
tideloc  = 1
----------------------------------------------------
Wave calculation options
bcfile   = bcfile.txt
----------------------------------------------------
Flow calculation options
nuh      = 0.1
nuhfac   = 1.0
----------------------------------------------------
Sediment transport calculation options
facua    = 0.10
D50      = 0.0002
----------------------------------------------------
Morphological calculation options
morfac   = 10
morstart = 3600
----------------------------------------------------
Output options
outputformat = netcdf
nglobalvar = 3
tunits = seconds since 2001-01-01

<command>
					<className>nl.deltares.fast.FastPostAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</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 to cil0_30mv3.xyz by replacing the tag $WAVE_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

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 post adapter converts model output (cil0_30mv3_out.asc) 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
titlepost adapter execute activity
			<executeActivity>
				<command>
					<className>nl.deltares.fast.FastPostAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</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>

Importing post adapter

Executing model run

The next activity will be executing the FAST model run. This is done by running FAST.exe in the workdir containing the model files.

...


			<executeActivity>
				<command>
					<executable>FAST.exe</executable>
				</command>
				<timeOut>99999999</timeOut>
			</executeActivity>

...

output

The last part of the general adapter run is importing the FAST output. xboutput.nc contains all parameter, output and grid information of the run. This can be visualized in FEWS after defining the needed parameters, location and grid. How to do this can be found here: FAST FEWS setuppost adapter output.

Code Block
xml
xml
titlemodel run output import activity

		<importActivities>
			<importPiNetcdfActivity><importNetcdfActivity>
				<importFile>xboutput<importFile>postAdapterOutput.nc</importFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_FAST<XBeach</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>H_max</parameterId>
						<locationId>Dummy<<locationId>Fast</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hournonequidistant"/>
						<readWriteMode>add<readWriteMode>read complete originals<forecast</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importPiNetcdfActivity>importNetcdfActivity>
		</importActivities>