WAVEWATCH III  beta 0.0.1
w3nmluprstrmd Module Reference

Data Types

type  nml_restart_t
 
type  nml_update_t
 

Functions/Subroutines

subroutine w3nmluprstr (NDSI, INFILE, NML_RESTART, NML_UPDATE, IERR)
 
subroutine read_restart_nml (NDSI, NML_RESTART)
 
subroutine read_update_nml (NDSI, NML_UPDATE)
 
subroutine report_restart_nml (NML_RESTART)
 
subroutine report_update_nml (NML_UPDATE)
 

Variables

character(256) msg
 
integer ndsn
 

Function/Subroutine Documentation

◆ read_restart_nml()

subroutine w3nmluprstrmd::read_restart_nml ( integer, intent(in)  NDSI,
type(nml_restart_t), intent(inout)  NML_RESTART 
)

Definition at line 169 of file w3nmluprstrmd.F90.

169  !/
170  !/ +-----------------------------------+
171  !/ | WAVEWATCH III NOAA/NCEP |
172  !/ | M. Accensi |
173  !/ | |
174  !/ | FORTRAN 90 |
175  !/ | Last update : 06-Oct-2020 |
176  !/ +-----------------------------------+
177  !/
178  ! 1. Purpose :
179  !
180  !
181  ! 2. Method :
182  !
183  ! See source term routines.
184  !
185  ! 3. Parameters :
186  !
187  ! Parameter list
188  ! ----------------------------------------------------------------
189  ! NDSI Int.
190  ! NML_RESTART Type.
191  ! ----------------------------------------------------------------
192  !
193  ! 4. Subroutines used :
194  !
195  ! Name TYPE Module Description
196  ! ----------------------------------------------------------------
197  ! STRACE Subr. W3SERVMD SUBROUTINE tracing.
198  ! ----------------------------------------------------------------
199  !
200  ! 5. Called by :
201  !
202  ! Name TYPE Module Description
203  ! ----------------------------------------------------------------
204  ! W3NMLUPRSTR Subr. N/A Namelist configuration routine.
205  ! ----------------------------------------------------------------
206  !
207  ! 6. Error messages :
208  !
209  ! None.
210  !
211  ! 7. Remarks :
212  !
213  ! 8. Structure :
214  !
215  ! See source code.
216  !
217  ! 9. Switches :
218  !
219  ! 10. Source code :
220  !
221  !/ ------------------------------------------------------------------- /
222 
223  USE w3odatmd, ONLY: ndse
224  USE w3servmd, ONLY: extcde
225 #ifdef W3_S
226  USE w3servmd, ONLY: strace
227 #endif
228 
229  IMPLICIT NONE
230 
231  INTEGER, INTENT(IN) :: NDSI
232  TYPE(NML_RESTART_T), INTENT(INOUT) :: NML_RESTART
233 
234  ! locals
235  INTEGER :: IERR
236  TYPE(NML_RESTART_T) :: RESTART
237  namelist /restart_nml/ restart
238 #ifdef W3_S
239  INTEGER, SAVE :: IENT = 0
240 #endif
241 
242  ierr = 0
243 #ifdef W3_S
244  CALL strace (ient, 'READ_RESTART_NML')
245 #endif
246 
247  ! set default values
248  restart%RESTARTTIME = '19680607 120000'
249 
250  ! read restart namelist
251  rewind(ndsi)
252  READ (ndsi, nml=restart_nml, iostat=ierr, iomsg=msg)
253  IF (ierr.NE.0) THEN
254  WRITE (ndse,'(A,/A)') &
255  'ERROR: READ_RESTART_NML: namelist read error', &
256  'ERROR: '//trim(msg)
257  CALL extcde (1)
258  END IF
259 
260  ! save namelist
261  nml_restart = restart
262 

References w3servmd::extcde(), msg, w3odatmd::ndse, and w3servmd::strace().

Referenced by w3nmluprstr().

◆ read_update_nml()

subroutine w3nmluprstrmd::read_update_nml ( integer, intent(in)  NDSI,
type(nml_update_t), intent(inout)  NML_UPDATE 
)

Definition at line 272 of file w3nmluprstrmd.F90.

272  !/
273  !/ +-----------------------------------+
274  !/ | WAVEWATCH III NOAA/NCEP |
275  !/ | M. Accensi |
276  !/ | |
277  !/ | FORTRAN 90 |
278  !/ | Last update : 06-Oct-2020 |
279  !/ +-----------------------------------+
280  !/
281  ! 1. Purpose :
282  !
283  !
284  ! 2. Method :
285  !
286  ! See source term routines.
287  !
288  ! 3. Parameters :
289  !
290  ! Parameter list
291  ! ----------------------------------------------------------------
292  ! NDSI Int.
293  ! NML_UPDATE Type.
294  ! ----------------------------------------------------------------
295  !
296  ! 4. Subroutines used :
297  !
298  ! Name TYPE Module Description
299  ! ----------------------------------------------------------------
300  ! STRACE Subr. W3SERVMD SUBROUTINE tracing.
301  ! ----------------------------------------------------------------
302  !
303  ! 5. Called by :
304  !
305  ! Name TYPE Module Description
306  ! ----------------------------------------------------------------
307  ! W3NMLUPRSTR Subr. N/A Namelist configuration routine.
308  ! ----------------------------------------------------------------
309  !
310  ! 6. Error messages :
311  !
312  ! None.
313  !
314  ! 7. Remarks :
315  !
316  ! 8. Structure :
317  !
318  ! See source code.
319  !
320  ! 9. Switches :
321  !
322  ! 10. Source code :
323  !
324  !/ ------------------------------------------------------------------- /
325 
326  USE w3odatmd, ONLY: ndse
327  USE w3servmd, ONLY: extcde
328 #ifdef W3_S
329  USE w3servmd, ONLY: strace
330 #endif
331 
332  IMPLICIT NONE
333 
334  INTEGER, INTENT(IN) :: NDSI
335  TYPE(NML_UPDATE_T), INTENT(INOUT) :: NML_UPDATE
336 
337  ! locals
338  INTEGER :: IERR
339  TYPE(NML_UPDATE_T) :: UPDATE
340  namelist /update_nml/ update
341 #ifdef W3_S
342  INTEGER, SAVE :: IENT = 0
343 #endif
344 
345  ierr = 0
346 #ifdef W3_S
347  CALL strace (ient, 'READ_UPDATE_NML')
348 #endif
349 
350  ! set default values for update approach
351  ! as set, these would run the update but not correct
352  ! any spectra (scalar correction by factor of 1.0)
353  update%UPDPROC = 'UPD0F' ! Update type
354  update%PRCNTG = 1.0 ! Scalar correction factor (1.0=no correction)
355  update%PRCNTGCAP = 10.0 ! Cap on correction factor
356  update%THRWSEA = 0.7 ! Energy threshold for wind-sea dominance
357  update%FILE = 'anl.grbtxt' ! Corrected analysed SWH field file
358 
359  ! read file namelist
360  rewind(ndsi)
361  READ (ndsi, nml=update_nml, iostat=ierr, iomsg=msg)
362  IF (ierr.GT.0) THEN
363  WRITE (ndse,'(A,/A)') &
364  'ERROR: READ_UPDATE_NML: namelist read error', &
365  'ERROR: '//trim(msg)
366  CALL extcde (2)
367  END IF
368 
369  ! save namelist
370  nml_update = update
371 

References w3servmd::extcde(), msg, w3odatmd::ndse, and w3servmd::strace().

Referenced by w3nmluprstr().

◆ report_restart_nml()

subroutine w3nmluprstrmd::report_restart_nml ( type(nml_restart_t), intent(in)  NML_RESTART)

Definition at line 381 of file w3nmluprstrmd.F90.

381  !/
382  !/ +-----------------------------------+
383  !/ | WAVEWATCH III NOAA/NCEP |
384  !/ | M. Accensi |
385  !/ | FORTRAN 90 |
386  !/ | Last update : 06-Oct-2020 |
387  !/ +-----------------------------------+
388  !/
389  !/
390  ! 1. Purpose :
391  !
392  !
393  ! 2. Method :
394  !
395  ! See source term routines.
396  !
397  ! 3. Parameters :
398  !
399  ! Parameter list
400  ! ----------------------------------------------------------------
401  ! NML_RESTART Type.
402  ! ----------------------------------------------------------------
403  !
404  ! 4. Subroutines used :
405  !
406  ! Name TYPE Module Description
407  ! ----------------------------------------------------------------
408  ! STRACE Subr. W3SERVMD SUBROUTINE tracing.
409  ! ----------------------------------------------------------------
410  !
411  ! 5. Called by :
412  !
413  ! Name TYPE Module Description
414  ! ----------------------------------------------------------------
415  ! W3NMLUPRSTR Subr. N/A Namelist configuration routine.
416  ! ----------------------------------------------------------------
417  !
418  ! 6. Error messages :
419  !
420  ! None.
421  !
422  ! 7. Remarks :
423  !
424  ! 8. Structure :
425  !
426  ! See source code.
427  !
428  ! 9. Switches :
429  !
430  ! 10. Source code :
431  !
432  !/ ------------------------------------------------------------------- /
433 
434 #ifdef W3_S
435  USE w3servmd, ONLY: strace
436 #endif
437 
438  IMPLICIT NONE
439 
440  TYPE(NML_RESTART_T), INTENT(IN) :: NML_RESTART
441 #ifdef W3_S
442  INTEGER, SAVE :: IENT = 0
443 #endif
444 
445 #ifdef W3_S
446  CALL strace (ient, 'REPORT_RESTART_NML')
447 #endif
448 
449  WRITE (msg,'(A)') 'RESTART % '
450  WRITE (ndsn,'(A)')
451  WRITE (ndsn,10) trim(msg),'RESTARTTIME = ', trim(nml_restart%RESTARTTIME)
452 
453 10 FORMAT (a,2x,a,a)
454 

References msg, ndsn, and w3servmd::strace().

Referenced by w3nmluprstr().

◆ report_update_nml()

subroutine w3nmluprstrmd::report_update_nml ( type(nml_update_t), intent(in)  NML_UPDATE)

Definition at line 464 of file w3nmluprstrmd.F90.

464  !/
465  !/ +-----------------------------------+
466  !/ | WAVEWATCH III NOAA/NCEP |
467  !/ | M. Accensi |
468  !/ | FORTRAN 90 |
469  !/ | Last update : 06-Oct-2020 |
470  !/ +-----------------------------------+
471  !/
472  !/
473  ! 1. Purpose :
474  !
475  !
476  ! 2. Method :
477  !
478  ! See source term routines.
479  !
480  ! 3. Parameters :
481  !
482  ! Parameter list
483  ! ----------------------------------------------------------------
484  ! NML_UPDATE Type.
485  ! ----------------------------------------------------------------
486  !
487  ! 4. Subroutines used :
488  !
489  ! Name TYPE Module Description
490  ! ----------------------------------------------------------------
491  ! STRACE Subr. W3SERVMD SUBROUTINE tracing.
492  ! ----------------------------------------------------------------
493  !
494  ! 5. Called by :
495  !
496  ! Name TYPE Module Description
497  ! ----------------------------------------------------------------
498  ! W3NMLUPRSTR Subr. N/A Namelist configuration routine.
499  ! ----------------------------------------------------------------
500  !
501  ! 6. Error messages :
502  !
503  ! None.
504  !
505  ! 7. Remarks :
506  !
507  ! 8. Structure :
508  !
509  ! See source code.
510  !
511  ! 9. Switches :
512  !
513  ! 10. Source code :
514  !
515  !/ ------------------------------------------------------------------- /
516 
517 #ifdef W3_S
518  USE w3servmd, ONLY: strace
519 #endif
520 
521  IMPLICIT NONE
522 
523  TYPE(NML_UPDATE_T), INTENT(IN) :: NML_UPDATE
524 #ifdef W3_S
525  INTEGER, SAVE :: IENT = 0
526 #endif
527 
528 #ifdef W3_S
529  CALL strace (ient, 'REPORT_UPDATE_NML')
530 #endif
531 
532  WRITE (msg,'(A)') 'UPDATE % '
533  WRITE (ndsn,'(A)')
534  WRITE (ndsn,10) trim(msg),'UPDPROC = ', trim(nml_update%UPDPROC)
535  ! PRCNTG only used by UPD0F
536  IF (trim(nml_update%UPDPROC) .EQ. 'UPD0F') THEN
537  WRITE (ndsn,11) trim(msg),'PRCNTG = ', nml_update%PRCNTG
538  ELSE
539  WRITE (ndsn,11) trim(msg),'PRCNTGCAP = ', nml_update%PRCNTGCAP
540  ! THRWSEA only used by UPD5/6
541  IF ((trim(nml_update%UPDPROC) .EQ. 'UPD5') .OR. &
542  (trim(nml_update%UPDPROC) .EQ. 'UPD6')) THEN
543  WRITE (ndsn,11) trim(msg),'THRWSEA = ', nml_update%THRWSEA
544  ENDIF
545  WRITE (ndsn,10) trim(msg),'FILE = ', trim(nml_update%FILE)
546  ENDIF
547 
548 10 FORMAT (a,2x,a,a)
549 11 FORMAT (a,2x,a,f5.3)
550 

References msg, ndsn, and w3servmd::strace().

Referenced by w3nmluprstr().

◆ w3nmluprstr()

subroutine w3nmluprstrmd::w3nmluprstr ( integer, intent(in)  NDSI,
character*(*), intent(in)  INFILE,
type(nml_restart_t), intent(inout)  NML_RESTART,
type(nml_update_t), intent(inout)  NML_UPDATE,
integer, intent(out)  IERR 
)

Definition at line 50 of file w3nmluprstrmd.F90.

50  !/
51  !/ +-----------------------------------+
52  !/ | WAVEWATCH III NOAA/NCEP |
53  !/ | M. Accensi |
54  !/ | |
55  !/ | FORTRAN 90 |
56  !/ | Last update : 06-Oct-2020 |
57  !/ +-----------------------------------+
58  !/
59  !
60  ! 1. Purpose :
61  !
62  ! Reads all the namelist to define the output field
63  !
64  ! 2. Method :
65  !
66  ! See source term routines.
67  !
68  ! 3. Parameters :
69  !
70  ! Parameter list
71  ! ----------------------------------------------------------------
72  ! NDSI Int.
73  ! INFILE Char.
74  ! NML_RESTART type.
75  ! NML_UPDATE type.
76  ! IERR Int.
77  ! ----------------------------------------------------------------
78  !
79  ! 4. Subroutines used :
80  !
81  ! Name TYPE Module Description
82  ! ----------------------------------------------------------------
83  ! STRACE Subr. W3SERVMD SUBROUTINE tracing.
84  ! READ_RESTART_NML
85  ! READ_UPDATE_NML
86  ! ----------------------------------------------------------------
87  !
88  ! 5. Called by :
89  !
90  ! Name TYPE Module Description
91  ! ----------------------------------------------------------------
92  ! WW3_UPRSTR Prog. N/A Update restart file
93  ! ----------------------------------------------------------------
94  !
95  ! 6. Error messages :
96  !
97  ! None.
98  !
99  ! 7. Remarks :
100  !
101  ! 8. Structure :
102  !
103  ! See source code.
104  !
105  ! 9. Switches :
106  !
107  ! 10. Source code :
108  !
109  !/ ------------------------------------------------------------------- /
110 
111  USE w3odatmd, ONLY: ndse
112 #ifdef W3_S
113  USE w3servmd, ONLY: strace
114 #endif
115 
116  IMPLICIT NONE
117 
118  INTEGER, INTENT(IN) :: NDSI
119  CHARACTER*(*), INTENT(IN) :: INFILE
120  TYPE(NML_RESTART_T), INTENT(INOUT) :: NML_RESTART
121  TYPE(NML_UPDATE_T), INTENT(INOUT) :: NML_UPDATE
122  INTEGER, INTENT(OUT) :: IERR
123 #ifdef W3_S
124  INTEGER, SAVE :: IENT = 0
125 #endif
126 
127  ierr = 0
128 #ifdef W3_S
129  CALL strace (ient, 'W3NMLUPRSTR')
130 #endif
131 
132  ! open namelist log file
133  ndsn = 3
134  OPEN (ndsn, file=trim(infile)//'.log', form='formatted', iostat=ierr)
135  IF (ierr.NE.0) THEN
136  WRITE (ndse,'(A)') 'ERROR: open full nml file '//trim(infile)//'.log failed'
137  RETURN
138  END IF
139 
140  ! open input file
141  OPEN (ndsi, file=trim(infile), form='formatted', status='old', iostat=ierr)
142  IF (ierr.NE.0) THEN
143  WRITE (ndse,'(A)') 'ERROR: open input file '//trim(infile)//' failed'
144  RETURN
145  END IF
146 
147  ! read restart time namelist
148  CALL read_restart_nml (ndsi, nml_restart)
149  CALL report_restart_nml (nml_restart)
150 
151  ! read update approach namelist
152  CALL read_update_nml (ndsi, nml_update)
153  CALL report_update_nml (nml_update)
154 
155  ! close namelist files
156  CLOSE (ndsi)
157  CLOSE (ndsn)
158 

References file(), w3odatmd::ndse, ndsn, read_restart_nml(), read_update_nml(), report_restart_nml(), report_update_nml(), and w3servmd::strace().

Referenced by w3uprstr().

Variable Documentation

◆ msg

character(256) w3nmluprstrmd::msg

Definition at line 41 of file w3nmluprstrmd.F90.

41  CHARACTER(256) :: MSG

Referenced by read_restart_nml(), read_update_nml(), report_restart_nml(), and report_update_nml().

◆ ndsn

integer w3nmluprstrmd::ndsn

Definition at line 42 of file w3nmluprstrmd.F90.

42  INTEGER :: NDSN

Referenced by report_restart_nml(), report_update_nml(), and w3nmluprstr().

scrip_timers::status
character(len=8), dimension(max_timers), save status
Definition: scrip_timers.f:63
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3servmd
Definition: w3servmd.F90:3
w3odatmd
Definition: w3odatmd.F90:3
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148