WAVEWATCH III  beta 0.0.1
w3wdasmd Module Reference

Intended as the interface for externally supplied data assimilation software. More...

Functions/Subroutines

subroutine w3wdas (DASFLAG, RECL, NDAT, DATA0, DATA1, DATA2)
 WAVEWATCH III data assimilation interface routine. More...
 

Detailed Description

Intended as the interface for externally supplied data assimilation software.

This module is intended as the interface for externally supplied data assimilation software to be used with WAVEWATCH III. The main subroutine W3WDAS is incorporated in the generic WAVEWATCH III shell ww3_shel, and thus provides integrated time management and running of the wave model and data assimilation side by side.

Present wave conditions (including dynamically changing wave grids), as well as wave data are passed to the routine through the dynamic data structrure, as introduced in model version 3.06.

A three tier data structure is used with three separate data sets. Tentatively, they are intended for mean wave parameters, 1-D and 2-D spectral data. This separation is made only for economy in file and memory usage. All three data sets are defined here only by a record length and a number of records. All data are treated as real numbers, but the meaning of all record components is completely at the discretion of the author of the data assimilation scheme.

To promote portability, it is suggested to use this module only as an interface to your own assimilation routine(s).

Author
H. L. Tolman
Date
06-Dec-2010

Function/Subroutine Documentation

◆ w3wdas()

subroutine w3wdasmd::w3wdas ( logical, dimension(3), intent(in)  DASFLAG,
integer, dimension(3), intent(in)  RECL,
integer, dimension(3), intent(in)  NDAT,
real, dimension(recl(1),ndat(1)), intent(in)  DATA0,
real, dimension(recl(2),ndat(2)), intent(in)  DATA1,
real, dimension(recl(3),ndat(3)), intent(in)  DATA2 
)

WAVEWATCH III data assimilation interface routine.

Parameters
[in]DASFLAGFLags for three data sets.
[in]RECLRecord lengths for three data sets.
[in]NDATNumber of data for three data sets.
[in]DATA0Observations.
[in]DATA1Observations.
[in]DATA2Observations.
Author
H. L. Tolman
Date
06-Dec-2010

Definition at line 133 of file w3wdasmd.F90.

133  !/
134  !/ +-----------------------------------+
135  !/ | WAVEWATCH III NOAA/NCEP |
136  !/ | H. L. Tolman |
137  !/ | FORTRAN 90 |
138  !/ | Last update : 06-Dec-2010 |
139  !/ +-----------------------------------+
140  !/
141  !/ 25-Jan-2002 : Origination. ( version 2.17 )
142  !/ 27-Dec-2004 : Multiple grid version. ( version 3.06 )
143  !/ 06-Dec-2010 : Change from GLOBAL (logical) to ICLOSE (integer) to
144  !/ specify index closure for a grid. ( version 3.14 )
145  !/ (T. J. Campbell, NRL)
146  !/
147  ! 1. Purpose :
148  !
149  ! WAVEWATCH III data assimilation interface routine.
150  !
151  ! 3. Parameters :
152  !
153  ! Parameter list
154  ! ----------------------------------------------------------------
155  ! DASFLAG L.A. I FLags for three data sets.
156  ! RECLD I.A. I Record lengths for three data sets.
157  ! ND I.A. I Number of data for three data sets.
158  ! DATAn R.A. I Observations.
159  ! ----------------------------------------------------------------
160  !
161  ! Local parameters :
162  ! ----------------------------------------------------------------
163  ! ----------------------------------------------------------------
164  !
165  ! 4. Subroutines used :
166  !
167  ! Name Type Module Description
168  ! ----------------------------------------------------------------
169  ! STRACE Subr. W3SERVMD Subroutine tracing.
170  ! EXTCDE Subr. W3SERVMD Program abort.
171  ! ----------------------------------------------------------------
172  !
173  ! 5. Called by :
174  !
175  ! Any program shell or integrated model after initialization of
176  ! WAVEWATCH III (to assure availability of data in used modules).
177  !
178  ! 6. Error messages :
179  !
180  ! 7. Remarks :
181  !
182  ! 8. Structure :
183  !
184  ! See source code.
185  !
186  ! 9. Switches :
187  !
188  ! !/S Enable subroutine tracing.
189  ! !/T Enable test output.
190  !
191  ! 10. Source code :
192  !
193  !/ ------------------------------------------------------------------- /
194  USE w3gdatmd
195  USE w3wdatmd
196  USE w3adatmd
197  USE w3odatmd, ONLY: ndso, ndse, ndst, screen, naproc, iaproc, &
199 #ifdef W3_S
200  USE w3servmd, ONLY: strace
201 #endif
202  !
203  IMPLICIT NONE
204  !
205 #ifdef W3_MPI
206  include "mpif.h"
207 #endif
208  !/
209  !/ ------------------------------------------------------------------- /
210  !/ Parameter list
211  !/
212  INTEGER, INTENT(IN) :: RECL(3), NDAT(3)
213  REAL, INTENT(IN) :: DATA0(RECL(1),NDAT(1))
214  REAL, INTENT(IN) :: DATA1(RECL(2),NDAT(2))
215  REAL, INTENT(IN) :: DATA2(RECL(3),NDAT(3))
216  LOGICAL, INTENT(IN) :: DASFLAG(3)
217  !/
218  !/ ------------------------------------------------------------------- /
219  !/ Local parameters :
220  !/
221  INTEGER :: J
222 #ifdef W3_T
223  INTEGER :: MREC, MDAT, IREC, IDAT
224 #endif
225 #ifdef W3_S
226  INTEGER, SAVE :: IENT = 0
227 #endif
228 #ifdef W3_T
229  REAL, ALLOCATABLE :: TDATA(:,:)
230 #endif
231  !/
232  !/ ------------------------------------------------------------------- /
233  ! 1. Initializations and test output
234  ! 1.a Subroutine tracing
235  !
236 #ifdef W3_S
237  CALL strace (ient, 'W3WDAS')
238 #endif
239  !
240  ! 1.b Echo part of parameter list (test output only).
241  !
242 #ifdef W3_T
243  WRITE (ndst,9000) ndso, ndse, ndst, screen, naproc, iaproc, &
244  napout, naperr, time
245  DO j=1, 3
246  IF ( dasflag(j) ) THEN
247  WRITE (ndst,9001) j, dasflag(j), recl(j), ndat(j)
248  mrec = min(recl(j),6)
249  mdat = min(ndat(j),10)
250  IF ( ALLOCATED(tdata) ) DEALLOCATE (tdata)
251  ALLOCATE ( tdata(recl(j),mdat) )
252  IF ( j .EQ. 1 ) tdata = data0(:,1:mdat)
253  IF ( j .EQ. 2 ) tdata = data1(:,1:mdat)
254  IF ( j .EQ. 3 ) tdata = data2(:,1:mdat)
255  DO idat=1, mdat
256  WRITE (ndst,9002) idat, tdata(1:mrec,idat)
257  IF ( mrec .LT. recl(j) ) WRITE (ndst,9003) &
258  tdata(mrec+1:recl(j),idat)
259  END DO
260  ELSE
261  WRITE (ndst,9001) j, dasflag(j)
262  END IF
263  END DO
264  IF ( ALLOCATED(tdata) ) DEALLOCATE (tdata)
265 #endif
266  !
267  ! 1.c Test grid info from W3GDATMD
268  !
269 #ifdef W3_T
270  WRITE (ndst,9010) nx, ny, nsea, nseal, nk, nth, &
271  iclose, flagll, sx, sy, x0, y0
272 #endif
273  !
274  ! 2. Actual data assimilation routine ------------------------------- /
275  !
276  ! User-defined data assimilation routines to be plugged in here.
277  ! All that could be needed is avainalble in this subroutine,
278  ! including the grid definition from W3GDATMD. All
279  ! can thus be included in the parameter list, and no explcit links
280  ! to other WAVEWATCH III routines will be needed within the
281  ! data assimilation routines ( with the possible exception of the
282  ! CONSTANTS module ), If there is a reason to terminate the code,
283  ! pass an error code out of the routine and use EXTCDE to stop
284  ! the WAVEWATCH III run altogether. Check the system documentation
285  ! on how to ad your routines to the compile and link system.
286  !
287  ! CALL .....
288  !
289  ! IF ( ..... ) CALL EXTCDE ( 99 )
290  !
291  RETURN
292  !
293  ! Formats
294  !
295  !1000 FORMAT (/' *** WAVEWATCH III ERROR IN W3WDAS :'/ &
296  ! ' ILLIGAL GRID SIZES INPUT : ',4I8/ &
297  ! ' GRID : ',4I8/)
298 #ifdef W3_T
299 9000 FORMAT ( ' TEST W3WDAS : UNIT NUMBERS : ',4i4/ &
300  ' MPI SETTINGS : ',4i4/ &
301  ' TIME : ',i8.8,i7.6)
302 9001 FORMAT ( ' DATASET INFO : ',i1,l2,2i8)
303 9002 FORMAT (17x,i2,6e10.3)
304 9003 FORMAT (19x, 6e10.3)
305 #endif
306  !
307 #ifdef W3_T
308 9010 FORMAT ( ' TEST W3WDAS : ARRAY DIMS. : ',6i8/ &
309  ' GRID : ',1i2,1l2,4e11.4)
310 #endif
311  !/
312  !/ End of W3WDAS ----------------------------------------------------- /
313  !/

References w3gdatmd::flagll, w3odatmd::iaproc, w3gdatmd::iclose, include(), w3odatmd::naperr, w3odatmd::naplog, w3odatmd::napout, w3odatmd::naproc, w3odatmd::ndse, w3odatmd::ndso, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nth, w3gdatmd::nx, w3gdatmd::ny, w3odatmd::screen, w3servmd::strace(), w3gdatmd::sx, w3gdatmd::sy, w3wdatmd::time, w3gdatmd::x0, and w3gdatmd::y0.

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::nseal
integer, pointer nseal
Definition: w3gdatmd.F90:1097
include
cmake src_list cmake include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_switches.cmake) check_switches("$
Definition: CMakeLists.txt:15
w3adatmd
Define data structures to set up wave model auxiliary data for several models simultaneously.
Definition: w3adatmd.F90:26
w3wdatmd
Define data structures to set up wave model dynamic data for several models simultaneously.
Definition: w3wdatmd.F90:18
w3gdatmd::sy
real, pointer sy
Definition: w3gdatmd.F90:1183
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
w3wdatmd::time
integer, dimension(:), pointer time
Definition: w3wdatmd.F90:172
w3gdatmd::ny
integer, pointer ny
Definition: w3gdatmd.F90:1097
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3odatmd::naperr
integer, pointer naperr
Definition: w3odatmd.F90:457
w3gdatmd::x0
real, pointer x0
Definition: w3gdatmd.F90:1183
w3gdatmd::nsea
integer, pointer nsea
Definition: w3gdatmd.F90:1097
w3servmd
Definition: w3servmd.F90:3
w3odatmd::naplog
integer, pointer naplog
Definition: w3odatmd.F90:457
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
w3odatmd::screen
integer, pointer screen
Definition: w3odatmd.F90:456
w3odatmd::naproc
integer, pointer naproc
Definition: w3odatmd.F90:457
w3gdatmd::iclose
integer, pointer iclose
Definition: w3gdatmd.F90:1096
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3odatmd::ndso
integer, pointer ndso
Definition: w3odatmd.F90:456
w3odatmd::napout
integer, pointer napout
Definition: w3odatmd.F90:457
w3gdatmd::y0
real, pointer y0
Definition: w3gdatmd.F90:1183
w3gdatmd::sx
real, pointer sx
Definition: w3gdatmd.F90:1183
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
w3gdatmd
Definition: w3gdatmd.F90:16
w3gdatmd::nx
integer, pointer nx
Definition: w3gdatmd.F90:1097
w3gdatmd::flagll
logical, pointer flagll
Definition: w3gdatmd.F90:1219