SWAN pre-adapter
Model pre-adapter for running SWAN (Simulating WAves Nearshore) model from Delft-FEWS.
For information about the SWAN model see http://www.swan.tudelft.nl/
...
In this section general information regarding the module such as version number, file directories, missing values, and time zone information can be specified.
Code Block |
---|
|
<general>
<description>SWAN model run</description>
<piVersion>1.8</piVersion>
<rootDir>%REGION_HOME%/Modules/Swan/$MODEL$</rootDir>
<workDir>%ROOT_DIR%/workDir</workDir>
<exportDir>%ROOT_DIR%/input</exportDir>
<exportDataSetDir>%ROOT_DIR%/</exportDataSetDir>
<exportIdMap>IdExport_$MODEL$</exportIdMap>
<importDir>%ROOT_DIR%/workDir</importDir>
<importIdMap>IdImport_$MODEL$</importIdMap>
<importUnitConversionsId>ImportUnitConversions</importUnitConversionsId>
<dumpFileDir>$GA_DUMPFILEDIR$</dumpFileDir>
<dumpDir>%ROOT_DIR%/diagnostics/</dumpDir>
<diagnosticFile>%ROOT_DIR%/diagnostics/diagnostics.xml</diagnosticFile>
<missVal>-999</missVal>
<timeZone>
<timeZoneName>GMT+0:00</timeZoneName>
</timeZone>
</general>
|
...
It may be useful to clear the model working directory of any previous runs before starting a new run.
Code Block |
---|
| xml |
---|
| xml |
---|
title | startUpActivitiesxml |
---|
|
<startUpActivities>
<purgeActivity>
<filter>%ROOT_DIR%/workDir/*</filter>
</purgeActivity>
</startUpActivities>
|
...
The run file contains information regarding the input file names, start and stop times, and time step. Additional properties can be passed using the run file as listed above under Properties.
Code Block |
---|
| xml |
---|
| xml |
---|
title | exportActivitiesxml |
---|
|
<exportActivities>
<exportStateActivity>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<stateExportDir>%ROOT_DIR%/stateInput</stateExportDir>
<stateSelection>
<warmState>
<stateSearchPeriod unit="hour" start="-1" end="0"/>
</warmState>
</stateSelection>
</exportStateActivity>
<exportDataSetActivity>
<moduleInstanceId>Swan_$MODEL$_$METEO$</moduleInstanceId>
</exportDataSetActivity>
<exportNetcdfActivity>
<exportFile>waterlevel.nc</exportFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>D3D_flow_dcsm5_hirlam72_hc</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>H.simulated</parameterId>
<locationId>dcsm5</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="hour"/>
<relativeViewPeriod unit="hour" start="-1" startOverrulable="true" end="0"/>
<readWriteMode>read only</readWriteMode>
<synchLevel>2</synchLevel>
</timeSeriesSet>
</timeSeriesSets>
</exportNetcdfActivity>
<exportNetcdfActivity>
<exportFile>$METEO$.nc</exportFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>Import_$METEO$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wind.u.simulated</parameterId>
<locationId>$METEO$_regular</locationId>
<timeSeriesType>external historical</timeSeriesType>
<timeStep unit="hour" multiplier="1"/>
<relativeViewPeriod unit="hour" start="-1" startOverrulable="true" end="0"/>
<readWriteMode>read only</readWriteMode>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>Import_$METEO$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wind.v.simulated</parameterId>
<locationId>$METEO$_regular</locationId>
<timeSeriesType>external historical</timeSeriesType>
<timeStep unit="hour" multiplier="1"/>
<relativeViewPeriod unit="hour" start="-1" startOverrulable="true" end="0"/>
<readWriteMode>read only</readWriteMode>
</timeSeriesSet>
</timeSeriesSets>
</exportNetcdfActivity>
<exportNetcdfActivity>
<exportFile>ecmwf_spectra.nc</exportFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>Import_ecmwf_spectra</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.variancedensity2D.simulated</parameterId>
<domainParameterId>f</domainParameterId>
<domainParameterId>dir</domainParameterId>
<locationSetId>ecmwf_spectra.locations</locationSetId>
<timeSeriesType>external historical</timeSeriesType>
<timeStep unit="hour" multiplier="6"/>
<relativeViewPeriod unit="hour" end="0"/>
<readWriteMode>read only</readWriteMode>
</timeSeriesSet>
</timeSeriesSets>
</exportNetcdfActivity>
<exportNetcdfRunFileActivity>
<description>This run file is passed as argument to SwanPreAdapter</description>
<exportFile>%WORK_DIR%\run_info.nc</exportFile>
<properties>
<string key="input_spectra_file_to_convert" value="..\input\ecmwf_spectra.nc"/>
<string key="template_swan_input_file" value="..\template\template.swn"/>
<string key="swan_input_file" value="INPUT"/>
</properties>
</exportNetcdfRunFileActivity>
</exportActivities>
|
...
This section calls the SWAN pre and post-adapters as well as the SWAN executable. Note: the run file must be passed as an argument to the SWAN pre and post-adapters.
Code Block |
---|
| xml |
---|
| xml |
---|
title | executeActivitiesxml |
---|
|
<executeActivities>
<executeActivity>
<command>
<className>nl.deltares.swan.SwanPreAdapter</className>
<binDir>..\..\..\bin\Swan_adapter\bin</binDir>
</command>
<arguments>
<argument>%WORK_DIR%\run_info.nc</argument>
</arguments>
<timeOut>99999999</timeOut>
<ignoreDiagnostics>true</ignoreDiagnostics>
</executeActivity>
<executeActivity>
<command>
<executable>..\..\..\bin\Swan\swan_4091AB_3_del_win_vs2010.exe</executable>
</command>
<arguments>
<argument>%WORK_DIR%\INPUT</argument>
</arguments>
<timeOut>99999999</timeOut>
<ignoreDiagnostics>true</ignoreDiagnostics>
</executeActivity>
<executeActivity>
<command>
<className>nl.deltares.swan.SwanPostAdapter</className>
<binDir>..\..\..\bin\Swan_adapter\bin</binDir>
</command>
<arguments>
<argument>%WORK_DIR%\run_info.nc</argument>
</arguments>
<timeOut>99999999</timeOut>
<ignoreDiagnostics>true</ignoreDiagnostics>
</executeActivity>
</executeActivities>
|
...
- Model state
- Output data (i.e. wind, water levels, wave spectra)
Code Block |
---|
| xml |
---|
| xml |
---|
title | importActivitiesxml |
---|
|
<importActivities>
<importStateActivity>
<stateFile>
<importFile>%ROOT_DIR%/workDir/swan-state.nc</importFile>
<relativeExportFile>swan-restart.nc</relativeExportFile>
</stateFile>
<expiryTime unit="day" multiplier="3"/>
</importStateActivity>
<importPiNetcdfActivity>
<importFile>..\output\SPEC2D_P1.nc</importFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>spectrum</valueType>
<parameterId>Wave.variancedensity2D.simulated</parameterId>
<domainParameterId>f</domainParameterId>
<domainParameterId>dir</domainParameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="hour"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
</timeSeriesSets>
</importPiNetcdfActivity>
<importPiNetcdfActivity>
<importFile>POINTS.nc</importFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.hm0.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.he10.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.period.Tm-1.0.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.dir.E10.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.s0bh.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>Wave.period.Tps.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>H.simulated</parameterId>
<locationSetId>$MODEL$.locations</locationSetId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>0</synchLevel>
<expiryTime unit="week" multiplier="1"/>
</timeSeriesSet>
</timeSeriesSets>
</importPiNetcdfActivity>
<importPiNetcdfActivity>
<importFile>..\output\swan2D.nc</importFile>
<timeSeriesSets>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wave.hm0.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wave.he10.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wave.period.Tm-1.0.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wave.period.Tps.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wave.th0.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>Wave.s0bh.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
<timeSeriesSet>
<moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>H.simulated</parameterId>
<locationId>$MODEL$</locationId>
<timeSeriesType>simulated historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>2</synchLevel>
<expiryTime unit="hour" multiplier="24"/>
</timeSeriesSet>
</timeSeriesSets>
</importPiNetcdfActivity>
</importActivities>
|