Page tree
Skip to end of metadata
Go to start of metadata

WES

WES is a two-dimensional model for hurricane calculations.

WES Module Adapter

This page describes the WES module adapter, its functions, and provides an example for configuring a WES run in FEWS.

Class names:

nl.deltares.wes.pre.WesPreAdapter
nl.deltares.wes.post.WesPostAdapter

Notes for users

WesPreAdapter

  • 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 wes.log.
  • This program uses the information in the specified netcdf run file as input and uses this information to do the following:
  • Take the values of the properties RADIUS_OF_CYCLONE and WIND_CONV_FAC to write it to wes_input.inp.
  • Take the values for all parameters and time steps from a netcdf file exported by FEWS and write it them to wes_adapter_track.trk.

WesPostAdapter

  • 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 wes.log.
  • Converts model output (wes_input.spw) in spiderweb grid format to fews netcdf rotated pole grid format.

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-httpclient-3.0.1.jar
    • Delft_Util.jar
    • fews-WES-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

Start up activities

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.

start up activities
		<startUpActivities>
			<purgeActivity>
				<filter>workDir*</filter>
			</purgeActivity>
		</startUpActivities>

Export activities

The first steps in the general adapter run are the netcdf and run file export activities. The <exportNetcdfActivity> will be a netcdf file which can have any name containing the variables called: lateral, longitudinal, Method, Vmax, Rmax, R100, R65, R50, R35, Par_A, Par_B, Pdrop. 

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.

export activities
		<exportActivities>
			<exportNetcdfActivity>
				<exportFile>zs0file.nc</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>lateral</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>longitudinal</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Method</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Vmax</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Rmax</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>R100</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>R65</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>R50</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>R35</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Par_B</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Par_A</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>Run_XBeach</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Pdrop</parameterId>
						<locationId>Dummy</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="day" start="-15" end="-9"/>
						<readWriteMode>editing visible to all future task runs</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportNetcdfActivity>
			<exportNetcdfRunFileActivity>
				<description>This run file is passed as argument to WesPreAdapter</description>
				<exportFile>run.nc</exportFile>
				<properties>
					<double value="1000000.0" key="RADIUS_OF_CYCLONE"/>
					<double value="0.88" key="WIND_CONV_FAC"/>
				</properties>
			</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.

execute activities
		<executeActivities>
            <executeActivity>
				<command>
					<className>nl.deltares.wes.pre.WesPreAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
				<logFile>
					<file>wes.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>wes.exe</executable>
				</command>
				<arguments>
					<argument>wes_input.inp</argument>
				</arguments>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
			<executeActivity>
				<command>
					<className>nl.deltares.wes.post.WesPostAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
				<logFile>
					<file>wes.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 WES input format.
The Pre adapter generates a log file called wes.log, which can be read into FEWS by coupling line patterns to FEWS log messages

Take the values of the properties RADIUS_OF_CYCLONE and WIND_CONV_FAC from run.nc to write it to wes_input.inp.

 Take the values for all parameters and time steps from a netcdf file exported by FEWS and write it them to wes_adapter_track.trk.

wes_input.inp
CYCLONE_PAR._FILE   = wes_adapter_track.trk
SPIDERS_WEB_DIMENS. = 500  36
RADIUS_OF_CYCLONE   = 1000000.0
WIND CONV. FAC (TRK)= 0.88
NO._OF_HIS._DATA    = 0
HIS._DATA_FILE_NAME =
OBS._DATA_FILE_NAME =
EXTENDED_REPORT     = yes

wes_adapter_track.trk
* File for tropical cyclone
* File contains Cyclone information ; TIMES in UTC
* File generated by WES adapter
* UNIT = Kts, Nmi ,Pa
* METHOD= 1:A&B;           4:Vm,Pd; Rw default
*         2:R100_etc;      5:Vm & Rw(RW may be default - US data; Pd = 2 Vm*Vm);
*         3:Vm,Pd,RmW,     6:Vm (Indian data); 7: OLD METHOD - Not adviced
* Dm    Vm
0.0 0.0
*    Date and time     lat     lon Method    Vmax    Rmax   R100    R65    R50    R35  Par B  Par A  Pdrop
* yyyy  mm  dd  HH     deg     deg    (-)   (kts)    (NM)   (NM)   (NM)   (NM)   (NM)    (-)    (-)   (Pa)
  2000  11  03  00   14.00  -80.00     4      30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    1400
  2000  11  03  06   15.00  -80.00     4      35   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    1500
  2000  11  03  12   16.00  -80.00     4      40   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    1600
  2000  11  03  18   17.00  -80.00     4      45   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    2000
  2000  11  04  00   17.00  -80.00     4      50   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    4000
  2000  11  04  06   17.00  -81.00     4      55   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    7000
  2000  11  04  12   18.00  -81.00     4      60   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   10000
  2000  11  04  18   18.00  -81.00     4      65   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   12000
  2000  11  05  00   18.00  -81.00     4      70   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   13000
  2000  11  05  06   18.00  -81.00     4      75   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   13000
  2000  11  05  12   19.00  -82.00     4      80   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   12000
  2000  11  05  18   19.00  -82.00     4      85   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   12000
  2000  11  06  00   19.00  -82.00     4      90   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   11000
  2000  11  06  06   20.00  -82.00     4      95   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   11000
  2000  11  06  12   20.00  -82.00     4     100   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   11000
  2000  11  06  18   20.00  -81.00     4     105   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   10000
  2000  11  07  00   21.00  -81.00     4     110   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   10000
  2000  11  07  06   21.00  -81.00     4     115   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    9000
  2000  11  07  12   21.00  -81.00     4     120   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    9000
  2000  11  07  18   21.00  -80.00     4     125   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    8000
  2000  11  08  00   20.00  -80.00     4     130   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    7000
  2000  11  08  06   20.00  -80.00     4     135   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    6000
  2000  11  08  12   19.00  -80.00     4     140   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    5000
  2000  11  08  18   19.00  -80.00     4     145   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    4000
  2000  11  09  00   18.00  -79.00     4     150   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30   1E+30    3000

Executing model run

This activity runs the model (wes.exe) in the workdir containing the model files with the input file names as arguments. The model creates the output file wes_input.spw which contains the grid information for FEWS (and the output file wes_input_wes.dia which is not used yet).

module run execute activity
			<executeActivity>
				<command>
					<executable>wes.exe</executable>
				</command>
				<arguments>
					<argument>wes_input.inp</argument>
				</arguments>
				<timeOut>99999999</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>

Executing post adapter

Converts model output (wes_input.spw) in spiderweb grid format to fews netcdf rotated pole grid format, for each time step a seperate netcdf file is created because each time step has a seperate grid definition.

The post adapter writes log messages to log file called wes.log which can be read into FEWS by coupling line patterns to FEWS log messages.

post adapter execute activity
			<executeActivity>
				<command>
					<className>nl.deltares.wes.post.WesPostAdapter</className>
					<binDir>adapter\bin</binDir>
				</command>
				<arguments>
					<argument>run.nc</argument>
				</arguments>
				<logFile>
					<file>wes.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. It uses <folder> and <fileNamePattern> in order to import the netcdf files for each time step.

model run output import activity
		<importActivities>
			<importNetcdfActivity>
				<folder>workdir</folder>
				<fileNamePatternFilter>wes_grid_*.nc</fileNamePatternFilter>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>Run_WES_Import</moduleInstanceId>
						<valueType>grid</valueType>
						<parameterId>Wind.speed</parameterId>
						<locationId>WilmaTest21</locationId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<readWriteMode>read complete forecast</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importNetcdfActivity>
		</importActivities>
  • No labels