From 319c8465bc6ba9b15784878e391b3b36f27e2956 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Fri, 21 Oct 2022 10:38:16 -0400 Subject: [PATCH 01/22] ww3_outp.F90: add doxygen markup --- model/src/ww3_outp.F90 | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/model/src/ww3_outp.F90 b/model/src/ww3_outp.F90 index 8edf73a287..975086dec0 100644 --- a/model/src/ww3_outp.F90 +++ b/model/src/ww3_outp.F90 @@ -1,5 +1,38 @@ +!> @file +!> @brief Post-processing of point output. +!> +!> @author H. L. Tolman +!> @author J.H. Alves +!> @author A. Chawla +!> @author F. Ardhuin +!> @author E. Rogers +!> @author T. Campbell +!> @date 27-Aug-2015 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Post-processing of point output. +!> +!> @details Data is read from the grid output file out_pnt.ww3 (raw data) +!> and from the file ww3_outp.inp ( NDSI, output requests ). Model +!> definition and raw data files are read using WAVEWATCH III subroutines. +!> +!> @author H. L. Tolman +!> @author J.H. Alves +!> @author A. Chawla +!> @author F. Ardhuin +!> @author E. Rogers +!> @author T. Campbell +!> @date 27-Aug-2015 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> PROGRAM W3OUTP !/ !/ +-----------------------------------+ @@ -983,6 +1016,16 @@ PROGRAM W3OUTP !/ CONTAINS !/ ------------------------------------------------------------------- / + +!> +!> @brief Perform actual point output. +!> +!> @author H. L. Tolman +!> @author J. H. Alves +!> @author F. Ardhuin +!> @author A. Chawla +!> @date 06-Feb-2014 +!> SUBROUTINE W3EXPO !/ !/ +-----------------------------------+ From 05ec7f92da5f89007e8caa2aeb6e4d01c25d297d Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Fri, 21 Oct 2022 10:53:59 -0400 Subject: [PATCH 02/22] ww3_outf.F90: add doxygen markup --- model/src/ww3_outf.F90 | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/model/src/ww3_outf.F90 b/model/src/ww3_outf.F90 index d8970978a6..1a55ccd7bc 100644 --- a/model/src/ww3_outf.F90 +++ b/model/src/ww3_outf.F90 @@ -1,5 +1,37 @@ +!> @file +!> @brief Post-processing of grid output. +!> +!> @author H. L. Tolman +!> @date 22-Mar-2021 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Post-processing of grid output. +!> +!> @details Data is read from the grid output file out_grd.ww3 (raw data) +!> and from the file ww3_outf.inp ( NDSI, output requests ). +!> Model definition and raw data files are read using WAVEWATCH III +!> subroutines. +!> +!> @verbatim +!> Output types : +!> 1 : print plots +!> 2 : field statistics +!> 3 : transfer file +!> 4 : text output at sea points (1:NSEA). +!> @endverbatim +!> +!> @author H. L. Tolman +!> @date 22-Mar-2021 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> PROGRAM W3OUTF !/ !/ +-----------------------------------+ @@ -497,6 +529,20 @@ PROGRAM W3OUTF !/ CONTAINS !/ ------------------------------------------------------------------- / + +!> +!> @brief Perform actual grid output. +!> +!> @details Note that arrays CX and CY of the main program now contain +!> the absolute current speed and direction respectively. +!> +!> @param NX X grid dimension +!> @param NY Y grid dimension +!> @param NSEA Number of sea points +!> +!> @author H. L. Tolman +!> @date 22-Mar-2021 +!> SUBROUTINE W3EXGO ( NX, NY, NSEA ) !/ !/ +-----------------------------------+ From 48e8297e9d2cb961a4a356137a7ae138d44cca68 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Fri, 21 Oct 2022 11:01:58 -0400 Subject: [PATCH 03/22] ww3_gspl.F90: add doxygen markup --- model/src/ww3_gspl.F90 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/model/src/ww3_gspl.F90 b/model/src/ww3_gspl.F90 index 344e38f6bc..dab308fd5d 100644 --- a/model/src/ww3_gspl.F90 +++ b/model/src/ww3_gspl.F90 @@ -1,18 +1,28 @@ !> @file !> @brief Contains the grid splitting program. !> -!> @author H. L. Tolman @date 18-Nov-2013 +!> @author H. L. Tolman +!> @date 18-Nov-2013 +!> #include "w3macros.h" - +!/ ------------------------------------------------------------------- / +!> !> @brief Grid splitting program !> !> @details Take an existing grid and create from this the grid data !> for a set of overlapping grids to be used in the ww3_multi code !> for hybid paralellization. !> -!> @author H. L. Tolman @date 18-Nov-2013 -!/ ------------------------------------------------------------------- / +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> +!> @author H. L. Tolman +!> @date 18-Nov-2013 +!> + PROGRAM W3GSPL !/ !/ +-----------------------------------+ From 78b58853dfe2969e22ee11840048a40c8faa441e Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Mon, 24 Oct 2022 18:10:36 -0400 Subject: [PATCH 04/22] ww3_systrk.F90: finish adding doxygen. fixed previous "date" doxygen error --- model/src/ww3_systrk.F90 | 55 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/model/src/ww3_systrk.F90 b/model/src/ww3_systrk.F90 index ca13678d08..813d3ceb04 100644 --- a/model/src/ww3_systrk.F90 +++ b/model/src/ww3_systrk.F90 @@ -4,7 +4,7 @@ !> @author A. J. van der Westhuysen !> @author Jeff Hanson !> @author Eve-Marie Devaliere -!> date 16-Jan-2017 +!> @date 16-Jan-2017 ! !/ ------------------------------------------------------------------- / !> @brief Perform spatial and temporal tracking of wave systems, based @@ -18,7 +18,13 @@ !> @author A. J. van der Westhuysen !> @author Jeff Hanson !> @author Eve-Marie Devaliere -!> date 16-Jan-2017 +!> @date 16-Jan-2017 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> ! PROGRAM WW3_SYSTRK !/ @@ -1099,6 +1105,25 @@ PROGRAM WW3_SYSTRK END PROGRAM WW3_SYSTRK ! #ifdef W3_TRKNC +!> +!> @brief N/A +!> +!> @param lons +!> @param lats +!> @param data_in +!> @param nlons +!> @param nlats +!> @param nsys +!> @param date1 +!> @param date2 +!> @param dt +!> @param ntime +!> @param ivar +!> @param outputType +!> +!> @author N/A +!> @date N/A +!> subroutine t2netcdf(lons,lats,data_in,nlons,nlats,nsys,date1,date2,& dt,ntime,ivar, outputType) USE W3TIMEMD @@ -1262,6 +1287,14 @@ end subroutine t2netcdf #endif ! #ifdef W3_TRKNC +!> +!> @brief N/A +!> +!> @param[in] status +!> +!> @author N/A +!> @date N/A +!> subroutine check(status) use netcdf integer, intent ( in) :: status @@ -1276,6 +1309,24 @@ end subroutine check #endif ! #ifdef W3_TRKNC +!> +!> @brief N/A +!> +!> @param longitude +!> @param latitude +!> @param hs +!> @param tp +!> @param dir +!> @param npoints +!> @param date1 +!> @param date2 +!> @param dt +!> @param ntime +!> @param outputType +!> +!> @author N/A +!> @date N/A +!> subroutine pt2netcdf(longitude,latitude,hs,tp,& dir,npoints,date1,date2,dt,ntime,outputType) USE W3TIMEMD From 625c11d411e7b900cc289dd1319a99ed1b539f1e Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Mon, 24 Oct 2022 20:05:03 -0400 Subject: [PATCH 05/22] wmesmfmd.F90: try to fix missing documentation. not successful. --- model/src/wmesmfmd.F90 | 298 +++++++++++++++++++++++------------------ 1 file changed, 170 insertions(+), 128 deletions(-) diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index f160964f4e..bae2530391 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -1,10 +1,10 @@ !> @file -!> @brief Contains module WMESMFMD. +!> @brief NUOPC based ESMF interface module for multi-grid wave model. !> !> @author T. J. Campell !> @author J. Meixner !> @author A. J. van der Westhuysen -!> @date 09-Aug-2017 +!> @date 09-Aug-2017 !> #include "w3macros.h" @@ -49,7 +49,7 @@ #define TEST_WMESMFMD_STOKES3D___disabled #define TEST_WMESMFMD_PSTOKES___disabled #define TEST_WMESMFMD_READFROMFILE___disabled -!/ + !/ ------------------------------------------------------------------- / !> !> @brief National Unified Prediction Capability (NUOPC) based @@ -62,7 +62,12 @@ !> @author T. J. Campell !> @author J. Meixner !> @author A. J. van der Westhuysen -!> @date 09-Aug-2017 +!> @date 09-Aug-2017 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. !> module WMESMFMD !/ @@ -328,18 +333,21 @@ module WMESMFMD type(ESMF_Field), allocatable :: mdtField(:) !< mdtField !/ !/ ------------------------------------------------------------------- / + contains + !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "SetServices" !> !> @brief Wave model ESMF set services. !> !> @param gcomp Gridded component. - !> @param[out] rc Return code. + !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "SetServices" + !> subroutine SetServices ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -496,21 +504,22 @@ subroutine SetServices ( gcomp, rc ) !/ end subroutine SetServices !/ ------------------------------------------------------------------- / + +#undef METHOD +#define METHOD "InitializeP0" !> !> @brief Initialize wave model (phase 0). !> !> @details Define the NUOPC Initialize Phase Mapping. !> - !> @param gcomp Gridded component. + !> @param gcomp Gridded component. !> @param impState Import state. !> @param expState Export state. !> @param extClock External clock. !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "InitializeP0" + !> subroutine InitializeP0 ( gcomp, impState, expState, extClock, rc ) !/ !/ +-----------------------------------+ @@ -653,21 +662,22 @@ subroutine InitializeP0 ( gcomp, impState, expState, extClock, rc ) !/ end subroutine InitializeP0 !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "InitializeP1" !> !> @brief Initialize wave model (phase 1). !> !> @details Advertise fields in import and export states. !> - !> @param gcomp Gridded component. + !> @param gcomp Gridded component. !> @param impState Import state. !> @param expState Export state. !> @param extClock External clock. !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "InitializeP1" + !> subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) !/ !/ +-----------------------------------+ @@ -1396,12 +1406,15 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) !/ end subroutine InitializeP1 !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "InitializeP3" !> !> @brief Initialize wave model (phase 3). !> !> @details Realize fields in import and export states. !> - !> @param gcomp Gridded component. + !> @param gcomp Gridded component. !> @param impState Import state. !> @param expState Export state. !> @param extClock External clock. @@ -1411,8 +1424,6 @@ end subroutine InitializeP1 !> @author A. J. van der Westhuysen !> @date 09-Aug-2017 !> -#undef METHOD -#define METHOD "InitializeP3" subroutine InitializeP3 ( gcomp, impState, expState, extClock, rc ) !/ !/ +-----------------------------------+ @@ -1754,16 +1765,17 @@ subroutine InitializeP3 ( gcomp, impState, expState, extClock, rc ) !/ end subroutine InitializeP3 !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "Finalize" !> !> @brief Finalize wave model. !> - !> @param gcomp Gridded component. + !> @param gcomp Gridded component. !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "Finalize" + !> subroutine Finalize ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -1978,16 +1990,17 @@ subroutine Finalize ( gcomp, rc ) !/ end subroutine Finalize !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "DataInitialize" !> !> @brief Initialize wave model export data !> - !> @param gcomp Gridded component. + !> @param gcomp Gridded component. !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "DataInitialize" + !> subroutine DataInitialize ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -2200,6 +2213,9 @@ subroutine DataInitialize ( gcomp, rc ) !/ end subroutine DataInitialize !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "ModelAdvance" !> !> @brief Advance wave model in time. !> @@ -2207,9 +2223,7 @@ end subroutine DataInitialize !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "ModelAdvance" + !> subroutine ModelAdvance ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -2404,6 +2418,9 @@ subroutine ModelAdvance ( gcomp, rc ) !/ end subroutine ModelAdvance !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "GetImport" !> !> @brief Get import fields and put in internal data structures. !> @@ -2411,9 +2428,7 @@ end subroutine ModelAdvance !> @param[out] rc Return code. !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "GetImport" + !> subroutine GetImport ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -2791,6 +2806,9 @@ subroutine GetImport ( gcomp, rc ) !/ end subroutine GetImport !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "SetExport" !> !> @brief Set export fields from internal data structures. !> @@ -2798,9 +2816,7 @@ end subroutine GetImport !> @param[out] rc Return code !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "SetExport" + !> subroutine SetExport ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -3025,6 +3041,9 @@ subroutine SetExport ( gcomp, rc ) !/ end subroutine SetExport !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CreateImpGrid" !> !> @brief Create ESMF grid for import fields. !> @@ -3032,9 +3051,7 @@ end subroutine SetExport !> @param[out] rc Return code !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "CreateImpGrid" + !> subroutine CreateImpGrid ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -3486,6 +3503,9 @@ subroutine CreateImpGrid ( gcomp, rc ) !/ end subroutine CreateImpGrid !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CreateExpGrid" !> !> @brief Create ESMF grid for export fields !> @@ -3493,9 +3513,7 @@ end subroutine CreateImpGrid !> @param[out] rc Return code !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "CreateExpGrid" + !> subroutine CreateExpGrid ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -4099,6 +4117,9 @@ subroutine CreateExpGrid ( gcomp, rc ) !/ end subroutine CreateExpGrid !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CreateImpMesh" !> !> @brief Create ESMF mesh (unstructured) for import fields. !> @@ -4112,9 +4133,7 @@ end subroutine CreateExpGrid !> @param[out] rc Return code !> !> @author A. J. van der Westhuysen @date 28-Feb-2018 - !> -#undef METHOD -#define METHOD "CreateImpMesh" + !> subroutine CreateImpMesh ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -4507,6 +4526,9 @@ subroutine CreateImpMesh ( gcomp, rc ) !/ end subroutine CreateImpMesh !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CreateExpMesh" !> !> @brief Create ESMF mesh (unstructured) for export fields. !> @@ -4527,9 +4549,7 @@ end subroutine CreateImpMesh !> @param[out] rc Return code !> !> @author A. J. van der Westhuysen @date 28-Feb-2018 - !> -#undef METHOD -#define METHOD "CreateExpMesh" + !> subroutine CreateExpMesh ( gcomp, rc ) !/ !/ +-----------------------------------+ @@ -5037,6 +5057,9 @@ subroutine CreateExpMesh ( gcomp, rc ) !/ end subroutine CreateExpMesh !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "SetupImpBmsk" !> !> @brief Setup background blending mask field for an import field. !> @@ -5046,9 +5069,7 @@ end subroutine CreateExpMesh !> @param rc Return code !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "SetupImpBmsk" + !> subroutine SetupImpBmsk( bmskField, impField, missingVal, rc ) !/ !/ +-----------------------------------+ @@ -5265,6 +5286,9 @@ subroutine SetupImpBmsk( bmskField, impField, missingVal, rc ) !/ end subroutine SetupImpBmsk !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "BlendImpField" !> !> @brief Blend import field with background field. !> @@ -5275,8 +5299,6 @@ end subroutine SetupImpBmsk !> !> @author T. J. Campbell @date 09-Aug-2017 !> -#undef METHOD -#define METHOD "BlendImpField" subroutine BlendImpField( impField, mbgField, bmskField, rc ) !/ !/ +-----------------------------------+ @@ -5377,6 +5399,9 @@ subroutine BlendImpField( impField, mbgField, bmskField, rc ) !/ end subroutine BlendImpField !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "SetupImpMmsk" !> !> @brief Setup merging mask field for an import field for the cases !> that model domains does not overlap completely. @@ -5388,9 +5413,7 @@ end subroutine BlendImpField !> @param rc Return code !> !> @author U. Turuncoglu @date 18-May-2021 - !> -#undef METHOD -#define METHOD "SetupImpMmsk" + !> subroutine SetupImpMmsk( mmskField, impField, fillVal, mskCreated, rc ) !/ !/ +-----------------------------------+ @@ -5518,17 +5541,18 @@ subroutine SetupImpMmsk( mmskField, impField, fillVal, mskCreated, rc ) !/ end subroutine SetupImpMmsk !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "FieldFill" !> !> @brief Fill ESMF field. !> - !> @param field - !> @param fillVal - !> @param rc + !> @param field ESMF field + !> @param fillVal Fill value + !> @param rc Return code !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "FieldFill" + !> subroutine FieldFill(field, fillVal, rc) !/ !/ +-----------------------------------+ @@ -5648,6 +5672,9 @@ subroutine FieldFill(field, fillVal, rc) !/ end subroutine FieldFill !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "FieldGather" !> !> @brief All gather of ESMF field. !> @@ -5659,10 +5686,8 @@ end subroutine FieldFill !> !> @author T. J. Campbell !> @author A. J. van der Westhuysen - !> @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "FieldGather" + !> @date 20-Jan-2017 + !> subroutine FieldGather(field, n1, n2, fout, rc) !/ !/ +-----------------------------------+ @@ -5815,18 +5840,19 @@ subroutine FieldGather(field, n1, n2, fout, rc) !/ end subroutine FieldGather !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "FieldIndex" !> !> @brief Return index associated with field name. !> - !> @param[inout] fnameList Array of field names - !> @param[inout] fname Field name - !> @param[inout] rc Return code - !> @returns indx Returned index of fname + !> @param fnameList Array of field names + !> @param fname Field name + !> @param rc Return code + !> @returns indx Returned index of fname !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "FieldIndex" + !> function FieldIndex ( fnameList, fname, rc ) result (indx) !/ !/ +-----------------------------------+ @@ -5909,18 +5935,19 @@ function FieldIndex ( fnameList, fname, rc ) result (indx) !/ end function FieldIndex !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "PrintTimers" !> !> @brief Print wallclock timers to ESMF log file. !> - !> @param cname - !> @param wtnam - !> @param wtcnt - !> @param wtime + !> @param cname Name of component + !> @param wtnam Timer names + !> @param wtcnt Timer counts + !> @param wtime Timers !> !> @author T. J. Campbell @date 20-Jan-2017 - !> -#undef METHOD -#define METHOD "PrintTimers" + !> subroutine PrintTimers ( cname, wtnam, wtcnt, wtime ) !/ !/ +-----------------------------------+ @@ -6004,22 +6031,23 @@ subroutine PrintTimers ( cname, wtnam, wtcnt, wtime ) !/ end subroutine PrintTimers !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcDecomp" !> !> @brief Calculate a 2D processor layout !> - !> @param[in] nx Grid dimension x - !> @param[in] ny Grid dimension y - !> @param[in] nproc Total processor count - !> @param[in] npmin Min number of grid points per tile per direction - !> @param[in] adjust Enable/disable adjusting proc count downward - !> @param[out] nxproc Processor count in x-direction - !> @param[out] nyproc Processor count in y-direction + !> @param[in] nx Grid dimension x + !> @param[in] ny Grid dimension y + !> @param[in] nproc Total processor count + !> @param[in] npmin Min number of grid points per tile per direction + !> @param[in] adjust Enable/disable adjusting proc count downward + !> @param[out] nxproc Processor count in x-direction + !> @param[out] nyproc Processor count in y-direction !> @param[inout] rc Return code !> !> @author T. J. Campbell @date 09-Aug-2017 !> -#undef METHOD -#define METHOD "CalcDecomp" subroutine CalcDecomp ( nx, ny, nproc, npmin, adjust, nxproc, nyproc, rc ) !/ !/ +-----------------------------------+ @@ -6150,17 +6178,18 @@ subroutine CalcDecomp ( nx, ny, nproc, npmin, adjust, nxproc, nyproc, rc ) !/ end subroutine CalcDecomp !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "GetEnvValue" !> !> @brief Get value of environment variable. !> - !> @param cenv Name of environment variable - !> @param cval Value of environment variable - !> @param rc Return code + !> @param cenv Name of environment variable + !> @param cval Value of environment variable + !> @param rc Return code !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "GetEnvValue" + !> subroutine GetEnvValue ( cenv, cval, rc ) !/ !/ +-----------------------------------+ @@ -6247,15 +6276,16 @@ subroutine GetEnvValue ( cenv, cval, rc ) !/ end subroutine GetEnvValue !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "GetZlevels" !> !> @brief Get array of z-levels from zlfile for SDC. !> - !> @param[inout] rc Return code + !> @param rc Return code !> !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "GetZlevels" + !> subroutine GetZlevels ( rc ) !/ !/ +-----------------------------------+ @@ -6362,16 +6392,17 @@ subroutine GetZlevels ( rc ) !/ end subroutine GetZlevels !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcCharnk" !> !> @brief Calculate Charnock for export. !> - !> @param chkField 2D Charnock export field - !> @param rc Return code - !> - !> @author T. J. Campbell @date 09-Aug-2017 + !> @param chkField 2D Charnock export field + !> @param rc Return code !> -#undef METHOD -#define METHOD "CalcCharnk" + !> @author T. J. Campbell + !> @date 09-Aug-2017 subroutine CalcCharnk ( chkField, rc ) !/ !/ +-----------------------------------+ @@ -6511,16 +6542,17 @@ subroutine CalcCharnk ( chkField, rc ) !/ end subroutine CalcCharnk !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcRoughl" !> !> @brief Calculate 2D wave roughness length for export. !> !> @param wrlField 2D roughness length export field !> @param rc Return code !> - !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "CalcRoughl" + !> @author T. J. Campbell + !> @date 09-Aug-2017 subroutine CalcRoughl ( wrlField, rc ) !/ !/ +-----------------------------------+ @@ -6664,19 +6696,22 @@ subroutine CalcRoughl ( wrlField, rc ) !/ end subroutine CalcRoughl !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcBotcur" !> !> @brief Calculate wave-bottom currents for export. !> + !> @details Madsen, O. S. (1994), ICCE. + !> !> @param a Input spectra (in par list to change shape) !> @param wbxField WBC 2D eastward-component export field !> @param wbyField WBC 2D northward-component export field !> @param wbpField WBC 2D period export field !> @param rc Return code !> - !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "CalcBotcur" + !> @author T. J. Campbell + !> @date 09-Aug-2017 subroutine CalcBotcur ( a, wbxField, wbyField, wbpField, rc ) !/ !/ +-----------------------------------+ @@ -6899,6 +6934,9 @@ subroutine CalcBotcur ( a, wbxField, wbyField, wbpField, rc ) !/ end subroutine CalcBotcur !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcRadstr2D" !> !> @brief Calculate 2D radiation stresses for export. !> @@ -6908,10 +6946,9 @@ end subroutine CalcBotcur !> @param[inout] syyField RS 2D northward-component field !> @param[inout] rc Return code !> - !> @author T. J. Campbell @date 09-Aug-2017 + !> @author T. J. Campbell + !> @date 09-Aug-2017 !> -#undef METHOD -#define METHOD "CalcRadstr2D" subroutine CalcRadstr2D ( a, sxxField, sxyField, syyField, rc ) !/ !/ +-----------------------------------+ @@ -7177,6 +7214,9 @@ subroutine CalcRadstr2D ( a, sxxField, sxyField, syyField, rc ) !/ end subroutine CalcRadstr2D !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcStokes3D" !> !> @brief Calculate 3D Stokes drift current for export. !> @@ -7185,10 +7225,9 @@ end subroutine CalcRadstr2D !> @param usyField 3D SDC northward-component export field !> @param rc Return code !> - !> @author T. J. Campbell @date 09-Aug-2017 - !> -#undef METHOD -#define METHOD "CalcStokes3D" + !> @author T. J. Campbell + !> @date 09-Aug-2017 + !> subroutine CalcStokes3D ( a, usxField, usyField, rc ) !/ !/ +-----------------------------------+ @@ -7437,6 +7476,9 @@ subroutine CalcStokes3D ( a, usxField, usyField, rc ) !/ end subroutine CalcStokes3D !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "CalcPStokes" !> !> @brief Calculate partitioned Stokes drift for export. !> @@ -7450,9 +7492,7 @@ end subroutine CalcStokes3D !> @param rc Return code !> !> @author J. Meixner @date 29-Oct-2019 - !> -#undef METHOD -#define METHOD "CalcPStokes" + !> subroutine CalcPStokes ( a, p1xField, p1yField, p2xField, & p2yField, p3xField, p3yField, rc ) !/ @@ -7649,20 +7689,22 @@ subroutine CalcPStokes ( a, p1xField, p1yField, p2xField, & !/ end subroutine CalcPStokes !/ ------------------------------------------------------------------- / + !/ +#undef METHOD +#define METHOD "ReadFromFile" !> !> @brief Read input file to fill unmapped point for regional applications. !> !> @param[inout] idfld Field name !> @param[inout] fldwx 2D eastward-component of field !> @param[inout] fldwy 2D northward-component of field - !> @param[in] time0 Time stamp for current time - !> @param[in] timen Time stamp for end time + !> @param[in] time0 Time stamp for current time + !> @param[in] timen Time stamp for end time !> @param[inout] rc Return code !> - !> @author U. Turuncoglu @date 18-May-2021 + !> @author U. Turuncoglu + !> @date 18-May-2021 !> -#undef METHOD -#define METHOD "ReadFromFile" subroutine ReadFromFile (idfld, fldwx, fldwy, time0, timen, rc) !/ !/ +-----------------------------------+ From 0c0ffbb3290c2102a68f1fabbfb9b41445fc40e3 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Tue, 25 Oct 2022 23:10:38 -0400 Subject: [PATCH 06/22] w3updtmd.F90: add doxygen markup --- model/src/w3updtmd.F90 | 173 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 172 insertions(+), 1 deletion(-) diff --git a/model/src/w3updtmd.F90 b/model/src/w3updtmd.F90 index 8ecd599865..72fdae7b20 100644 --- a/model/src/w3updtmd.F90 +++ b/model/src/w3updtmd.F90 @@ -1,5 +1,24 @@ +!> @file +!> @brief Bundles all input updating routines for WAVEWATCH III. +!> +!> @author H. L. Tolman +!> @date 22-Mar-2021 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Bundles all input updating routines for WAVEWATCH III. +!> +!> @author H. L. Tolman +!> @date 22-Mar-2021 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> MODULE W3UPDTMD !/ !/ +-----------------------------------+ @@ -136,6 +155,19 @@ MODULE W3UPDTMD !/ CONTAINS !/ ------------------------------------------------------------------- / + + !> + !> @brief Interpolate the current field to the present time. + !> + !> @details Linear interpolation of speed and direction, with optionally + !> a correction to get approximate quadratic interpolation of speed + !> only. + !> + !> @param[in] FLFRST Flag for first pass through routine. + !> + !> @author H. L. Tolman + !> @date 15-Dec-2004 + !> SUBROUTINE W3UCUR ( FLFRST ) !/ !/ +-----------------------------------+ @@ -439,6 +471,20 @@ SUBROUTINE W3UCUR ( FLFRST ) !/ END SUBROUTINE W3UCUR !/ ------------------------------------------------------------------- / + + !> + !> @brief Interpolate wind fields to the given time. + !> + !> @details Linear interpolation of wind speed and direction, with a + !> simple correction to obtain quasi-conservation of energy. + !> + !> @param[in] FLFRST Flag for first pass through routine. + !> @param[in] VGX Grid velocity + !> @param[in] VGY Grid velocity + !> + !> @author H. L. Tolman + !> @date 27-May-2014 + !> SUBROUTINE W3UWND ( FLFRST, VGX, VGY ) !/ !/ +-----------------------------------+ @@ -768,6 +814,17 @@ SUBROUTINE W3UWND ( FLFRST, VGX, VGY ) !/ END SUBROUTINE W3UWND !/ ------------------------------------------------------------------- / + !> + !> @brief Interpolate atmosphere momentum fields to the given time. + !> + !> @details Linear interpolation of momentum module and direction, with + !> a simple correction to obtain quasi-conservation of energy. + !> + !> @param[in] FLFRST Flag for first pass through routine. + !> + !> @author J. M. Castillo + !> @date 22-Mar-2021 + !> SUBROUTINE W3UTAU ( FLFRST ) !/ !/ +-----------------------------------+ @@ -974,6 +1031,21 @@ SUBROUTINE W3UTAU ( FLFRST ) !/ END SUBROUTINE W3UTAU !/ ------------------------------------------------------------------- / + !> + !> @brief Initialize the wave field with fetch-limited spectra before + !> the actual calculation start. + !> + !> + !> @details Named as an update routine due to placement in code. + !> + !> Fetch-limited JONSWAP spectra with a cosine^2 directional + !> distribution and a mean direction taken from the wind. + !> + !> @param[out] A Action density spectra. + !> + !> @author H. L. Tolman + !> @date 06-Jun-2018 + !> SUBROUTINE W3UINI ( A ) !/ !/ +-----------------------------------+ @@ -1229,6 +1301,15 @@ SUBROUTINE W3UINI ( A ) !/ END SUBROUTINE W3UINI !/ ------------------------------------------------------------------- / + !> + !> @brief Update spectra at the active boundary points. + !> + !> @details Spectra are read and interpolated in space and time from + !> the data read by W3IOBC. + !> + !> @author H. L. Tolman + !> @date 06-Jun-2018 + !> SUBROUTINE W3UBPT !/ !/ +-----------------------------------+ @@ -1420,6 +1501,14 @@ SUBROUTINE W3UBPT !/ END SUBROUTINE W3UBPT !/ ------------------------------------------------------------------- / + !> @attn FLFRST not used. + !> @brief Update ice thickness in the wave model. + !> + !> @param[in] FLFRST + !> + !> @author C. Sevigny + !> @date 27-Aug-2015 + !> SUBROUTINE W3UIC1( FLFRST ) !/ !/ +-----------------------------------+ @@ -1522,6 +1611,16 @@ SUBROUTINE W3UIC1( FLFRST ) !/ END SUBROUTINE W3UIC1 !/ ------------------------------------------------------------------- / + + !> @attn FLFRST not currently used. + !> @brief Update ice floe mean and max diameters in the wave model. + !> + !> @param[in] FLFRST + !> + !> @author C. Sevigny + !> @author F. Ardhuin + !> @date 13-Jan-2016 + !> SUBROUTINE W3UIC5( FLFRST ) !/ !/ +-----------------------------------+ @@ -1636,7 +1735,25 @@ SUBROUTINE W3UIC5( FLFRST ) !/ END SUBROUTINE W3UIC5 !/ ------------------------------------------------------------------- / - + +!> +!> @brief Update ice map in the wave model. +!> +!> @details Points with an ice concentration larger than FICEN are +!> removed from the sea map in the wave model. Such points are +!> identified by negative numbers is the grid status map MAPSTA. For +!> ice points spectra are set to zero. Points from wich ice disappears +!> are initialized with a "small" JONSWAP spectrum, based on the +!> frequency SIG(NK-1) and the local wind direction. +!> +!> In the case of icebergs, the iceberg attenuation coefficient is +!> added to the subgrid obstruction map. +!> +!> @param[inout] VA Spectra in 1-D or 2-D representation. +!> +!> @author H. L. Tolman +!> @date 28-Mar-2014 +!> SUBROUTINE W3UICE ( VA ) !/ !/ +-----------------------------------+ @@ -1874,6 +1991,18 @@ SUBROUTINE W3UICE ( VA ) !/ END SUBROUTINE W3UICE !/ ------------------------------------------------------------------- / + !> + !> @brief Update the water level. + !> + !> @details The wavenumber grid is modified without modyfying the + !> spectrum (conservative linear interpolation to new grid). + !> + !> @param[inout] A 2-D represetation of the spectra. + !> @param[inout] VA 1-D represetation of the spectra. + !> + !> @author H. L. Tolman + !> @date 26-Sep-2012 + !> SUBROUTINE W3ULEV ( A, VA ) !/ !/ +-----------------------------------+ @@ -2400,6 +2529,16 @@ SUBROUTINE W3ULEV ( A, VA ) !/ END SUBROUTINE W3ULEV !/ ------------------------------------------------------------------- / + !> + !> @brief Interpolate air density field to the given time. + !> + !> @details Linear interpolation. + !> + !> @param[in] FLFRST Flag for first pass through routine. + !> + !> @author J. M. Castillo + !> @date 13-Aug-2021 + !> SUBROUTINE W3URHO ( FLFRST ) !/ !/ +-----------------------------------+ @@ -2568,6 +2707,23 @@ SUBROUTINE W3URHO ( FLFRST ) !/ END SUBROUTINE W3URHO !/ ------------------------------------------------------------------- / + !> + !> @brief Update cell boundary transparencies for general use in + !> propagation routines. + !> + !> @details Two arrays are generated with the size (NY*NX,-1:1). The value + !> at (IXY,-1) indicates the transparency to be used if the lower + !> or left boundary is an inflow boundary. (IXY,1) is used if the + !> upper or right boundary is an inflow boundary. (IXY,0) is used + !> + for all other cases (by definition full transparency). + !> + !> @param[inout] TRNX Transparencies from model definition file. + !> @param[inout] TRNY Transparencies from model definition file. + !> + !> @author H. L. Tolman + !> @date 30-Oct-2009 + !> SUBROUTINE W3UTRN ( TRNX, TRNY ) !/ !/ +-----------------------------------+ @@ -2956,6 +3112,21 @@ SUBROUTINE W3UTRN ( TRNX, TRNY ) !/ END SUBROUTINE W3UTRN !/ ------------------------------------------------------------------- / + !> + !> @brief Calculate derivatives of a field. + !> + !> @details Derivatives are calculated in m/m from the longitude/latitude + !> grid, central in space for iternal points, one-sided for coastal + !> points. + !> + !> @param[in] ZZ Field to calculate derivatives of. + !> @param[in] ZUNIT Units of ZZ (used for test output). + !> @param[out] DZZDX Derivative in X-direction (W-E). + !> @param[out] DZZDY Derivative in Y-direction (S-N). + !> + !> @author W. E. Rogers, NRL + !> @date 06-Dec-2010 + !> SUBROUTINE W3DZXY( ZZ, ZUNIT, DZZDX, DZZDY ) !/ !/ +-----------------------------------+ From c596d5195bb41bfedd9470a8189877ea2b00d5de Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Wed, 26 Oct 2022 12:31:16 -0400 Subject: [PATCH 07/22] w3uostmd.F90: add doxygen markup --- model/src/w3uostmd.F90 | 190 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 185 insertions(+), 5 deletions(-) diff --git a/model/src/w3uostmd.F90 b/model/src/w3uostmd.F90 index 35494b321c..110e1f4138 100644 --- a/model/src/w3uostmd.F90 +++ b/model/src/w3uostmd.F90 @@ -1,5 +1,24 @@ +!> @file +!> @brief Parmeterization of the unresoled obstacles. +!> +!> @author Lorenzo Mentaschi +!> @date 08-Oct-2018 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Parmeterization of the unresoled obstacles. +!> +!> @author Lorenzo Mentaschi +!> @date 08-Oct-2018 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> MODULE W3UOSTMD !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -83,6 +102,23 @@ MODULE W3UOSTMD !/ ------------------------------------------------------------------- / + + !> + !> @brief Allocate the UOST variables for a given grid, and load + !> them from file. + !> + !> @param[in] IGRID Id of the grid being initialized. + !> @param[in] FILELOCAL File from where the alpha/beta coefficient + !> for the local dissipation are loaded. + !> @param[in] FILESHADOW File from where the alpha/beta coefficient + !> for the shadow effect are loaded. + !> @param[in] LOCALFACTOR Adjustment parameter for the local + !> dissipation alpha and beta. + !> @param[in] SHADOWFACTOR Adjustment parameter for the shadow + !> dissipation alpha and beta. + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_INITGRID(IGRID, FILELOCAL, FILESHADOW, LOCALFACTOR, SHADOWFACTOR) !/ !/ +-----------------------------------+ @@ -183,6 +219,15 @@ END SUBROUTINE UOST_INITGRID !/ ------------------------------------------------------------------- / + + !> + !> @brief Sets the current grid in the sourceterm object. + !> + !> @param[in] IGRID Id of the actual grid. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_SETGRID(IGRID) !/ !/ +-----------------------------------+ @@ -233,8 +278,23 @@ SUBROUTINE UOST_SETGRID(IGRID) END SUBROUTINE UOST_SETGRID !/ ------------------------------------------------------------------- / - !/ ------------------------------------------------------------------- / + !> + !> @brief Estimates the UOST source term for a give spectrum. + !> + !> @param[in] IX + !> @param[in] IY + !> @param[in] SPEC + !> @param[in] CG + !> @param[in] DT + !> @param[in] U10ABS + !> @param[in] U10DIR + !> @param[out] S + !> @param[out] D + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_SRCTRMCOMPUTE(IX, IY, SPEC, CG, DT, U10ABS, U10DIR, S, D) !/ !/ +-----------------------------------+ @@ -283,6 +343,19 @@ SUBROUTINE UOST_SRCTRMCOMPUTE(IX, IY, SPEC, CG, DT, U10ABS, U10DIR, S, D) END SUBROUTINE UOST_SRCTRMCOMPUTE !/ ------------------------------------------------------------------- / + + !> + !> @brief Loads local and shadow alpha and beta from files. + !> + !> @param[inout] GRD Object representing the spatial grid to + !> be loaded. + !> @param[inout] SRD Object representing the current spectral + !> grid. + !> @param[inout] FILEUNIT Unit id of the input files. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE LOAD_ALPHABETA(GRD, SGD, FILEUNIT) !/ !/ +-----------------------------------+ @@ -371,6 +444,27 @@ SUBROUTINE LOAD_ALPHABETA(GRD, SGD, FILEUNIT) END SUBROUTINE LOAD_ALPHABETA !/ ------------------------------------------------------------------- / + + !> + !> @brief Loads alpha and beta from a single obstructions file. + !> + !> @param[in] FILEUNIT Unit of the file to be opened. + !> @param[in] FILENAME Name of the file. + !> @param[in] NX Size of spatial grid X dim. + !> @param[in] NY Size of spatial grid Y dim. + !> @param[in] NK Size of spectral grid K dim. + !> @param[in] NTH Size of spectral grid TH dim. + !> @param[in] MULTFACTOR Multiplication factor for alpha and beta. + !> @param[inout] ALPHAMTX Loaded alpha spatial/spectral matrices. + !> @param[inout] BETAMTX Loaded beta spatial/spectral matrices. + !> @param[inout] CELLSIZE Cell size for each spectral direction, + !> also loaded from the file. + !> @param[inout] ISOBSTRUCTED Matrix of logicals, indicating for each cell + !> if it is obstructed or not. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE LOAD_ALPHABETA_FROMFILE(FILEUNIT, FILENAME, NX, NY, NK, NTH,& MULTFACTOR, ALPHAMTX, BETAMTX, CELLSIZE, ISOBSTRUCTED) !/ @@ -500,7 +594,19 @@ SUBROUTINE LOAD_ALPHABETA_FROMFILE(FILEUNIT, FILENAME, NX, NY, NK, NTH,& END SUBROUTINE LOAD_ALPHABETA_FROMFILE !/ ------------------------------------------------------------------- / - + + !> + !> @brief Method of the class UOST_SOURCETERM, to set the + !> actual spatial and spectral grid. + !> + !> @param[inout] THIS + !> @param[in] GRD Object representing the spatial grid to + !> be loaded. + !> @param[in] SGD Object representing the current spectral grid. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_SOURCETERM_SETGRID(THIS, GRD, SGD) !/ !/ +-----------------------------------+ @@ -566,7 +672,23 @@ END SUBROUTINE UOST_SOURCETERM_SETGRID !/ ------------------------------------------------------------------- / - + !> + !> @brief In conditions of wind sea, the effect of the unresolved + !> obstacles is reduced. + !> + !> @details Here a reduction psi is computed, as a function of the + !> wave age. + !> + !> @param[in] U10ABS Absolute value of U10. + !> @param[in] U10DIR Direction of U10. + !> @param[in] CGABS Absolute value of the group velocity. + !> @param[in] CGDIR Direction of the group velocity. + !> @param[in] DT Time step. + !> @param[out] PSI Output psi factor. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE COMPUTE_REDUCTION_PSI(U10ABS, U10DIR, CGABS, CGDIR, DT, PSI) !/ !/ +-----------------------------------+ @@ -652,7 +774,26 @@ SUBROUTINE COMPUTE_REDUCTION_PSI(U10ABS, U10DIR, CGABS, CGDIR, DT, PSI) END SUBROUTINE COMPUTE_REDUCTION_PSI !/ ------------------------------------------------------------------- / - + + !> + !> @brief Method of the class UOST_SOURCETERM. + !> + !> @details Computation of the local dissipation of the spectrum. + !> + !> @param[inout] THIS Instance of UOST_SOURCETERM passed to the method. + !> @param[in] IX X coordinates of actual call. + !> @param[in] IY Y coordinates of actual call. + !> @param[in] SPEC Input spectrum. + !> @param[in] CG Group velocity. + !> @param[in] DT Time step. + !> @param[in] U10ABS Absolute value of U10. + !> @param[in] U10DIR Direction of U10. + !> @param[out] S Source term. + !> @param[out] D Differential of the source term over the spectrum. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_SOURCETERM_COMPUTE_LD(THIS, IX, IY, SPEC, CG, DT, U10ABS, U10DIR, S, D) !/ !/ +-----------------------------------+ @@ -761,6 +902,26 @@ SUBROUTINE UOST_SOURCETERM_COMPUTE_LD(THIS, IX, IY, SPEC, CG, DT, U10ABS, U10DIR END SUBROUTINE UOST_SOURCETERM_COMPUTE_LD !/ ------------------------------------------------------------------- / + + !> + !> @brief Method of the class UOST_SOURCETERM. + !> + !> @details Computation of the shadow dissipation of the spectrum. + !> + !> @param[inout] THIS Instance of UOST_SOURCETERM passed to the method. + !> @param[in] IX X coordinates of actual call. + !> @param[in] IY Y coordinates of actual call. + !> @param[in] SPEC Input spectrum. + !> @param[in] CG Group velocity. + !> @param[in] DT Time step. + !> @param[in] U10ABS Absolute value of U10. + !> @param[in] U10DIR Direction of U10. + !> @param[out] S Source term. + !> @param[out] D Differential of the source term over the spectrum. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_SOURCETERM_COMPUTE_SE(THIS, IX, IY, SPEC, CG, DT, U10ABS, U10DIR, S, D) !/ !/ +-----------------------------------+ @@ -878,7 +1039,26 @@ SUBROUTINE UOST_SOURCETERM_COMPUTE_SE(THIS, IX, IY, SPEC, CG, DT, U10ABS, U10DIR END SUBROUTINE UOST_SOURCETERM_COMPUTE_SE !/ ------------------------------------------------------------------- / - + + !> + !> @brief Method of the class UOST_SOURCETERM. + !> + !> @details Computation of the source term. + !> + !> @param[inout] THIS Instance of UOST_SOURCETERM passed to the method. + !> @param[in] IX X coordinates of actual call. + !> @param[in] IY Y coordinates of actual call. + !> @param[in] SPEC Input spectrum. + !> @param[in] CG Group velocity. + !> @param[in] DT Time step. + !> @param[in] U10ABS Absolute value of U10. + !> @param[in] U10DIR Direction of U10. + !> @param[out] S Source term. + !> @param[out] D Differential of the source term over the spectrum. + !> + !> @author Lorenzo Mentaschi + !> @date 01-Oct-2018 + !> SUBROUTINE UOST_SOURCETERM_COMPUTE(THIS, IX, IY, SPEC, CG, DT, U10ABS, U10DIR, S, D) !/ !/ +-----------------------------------+ From 643e21eee0cc4e86a442d2f75570d9179e85493d Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Wed, 26 Oct 2022 15:25:27 -0400 Subject: [PATCH 08/22] w3triamd.F90: add doxygen markup --- model/src/w3triamd.F90 | 284 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 283 insertions(+), 1 deletion(-) diff --git a/model/src/w3triamd.F90 b/model/src/w3triamd.F90 index ffa60a36ac..ca18a57366 100644 --- a/model/src/w3triamd.F90 +++ b/model/src/w3triamd.F90 @@ -1,5 +1,23 @@ +!> @file +!> @brief Reads triangle and unstructured grid information. +!> +!> @author F. Ardhuin +!> @author A. Roland +!> @date 26-Jan-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Reads triangle and unstructured grid information. +!> +!> @details Look for namelist with name NAME in unit NDS and read if found. +!> +!> @author F. Ardhuin +!> @author A. Roland +!> @date 26-Jan-2014 +!> MODULE W3TRIAMD !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -98,6 +116,20 @@ MODULE W3TRIAMD CONTAINS !/ -------------------------------------------------------------------/ + + !> + !> @brief Reads triangle and unstructured grid information from GMSH files. + !> + !> @details Calls the subroutines needed to compute grid connectivity. + !> Look for namelist with name NAME in unit NDS and read if found. + !> + !> @param[in] NDS Data set number used for search. + !> @param[in] FNAME Name of namelist. + !> + !> @author F. Ardhuin + !> @author A. Roland + !> @date 06-Jun-2018 + !> SUBROUTINE READMSH(NDS,FNAME) !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -340,6 +372,19 @@ SUBROUTINE READMSH(NDS,FNAME) CLOSE(NDS) END SUBROUTINE READMSH !/--------------------------------------------------------------------/ + + !> + !> @brief Reads triangle and unstructured grid information from GMSH files. + !> + !> @details Calls the subroutines needed to compute grid connectivity. + !> Look for namelist with name NAME in unit NDS and read if found. + !> + !> @param[in] NDS Data set number used for search. + !> @param[in] FNAME Name of namelist. + !> + !> @author + !> @date + !> SUBROUTINE READMSH_IOBP(NDS,FNAME) !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -452,6 +497,16 @@ SUBROUTINE READMSH_IOBP(NDS,FNAME) CLOSE(NDS) END SUBROUTINE READMSH_IOBP !/--------------------------------------------------------------------/ + + !> + !> @brief Boundary status (code duplication). + !> + !> @param[out] STATUS + !> + !> @author Mathieu Dutour-Sikiric + !> @author Aron Roland + !> @date 01-May-2018 + !> SUBROUTINE GET_BOUNDARY_STATUS(STATUS) !/ !/ +-----------------------------------+ @@ -598,6 +653,19 @@ SUBROUTINE GET_BOUNDARY_STATUS(STATUS) END SUBROUTINE GET_BOUNDARY_STATUS !/ -------------------------------------------------------------------/ + + !> + !> @brief Reads open boundary information for UNST grids following + !> GMESH type format. + !> + !> @param[in] NDS Data set number used for search. + !> @param[in] FNAME File name. + !> @param[inout] TMPSTA Status map to be updated (for OBC,TMPSTA = 2). + !> @param[out] UGOBCOK Flag for proper reading of OBC file. + !> + !> @author F. Ardhuin + !> @date 14-Mar-2018 + !> SUBROUTINE READMSHOBC(NDS, FNAME, TMPSTA, UGOBCOK) !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -713,6 +781,18 @@ END SUBROUTINE READMSHOBC !/ ------------------------------------------------------------------- / + !> + !> @brief Defines open boundary points based on depth. + !> + !> @details A boundary node has more node around it than triangles. + !> + !> @param[inout] TMPSTA Status map to be updated (for OBC, TMPSTA = 2). + !> @param[in] ZBIN + !> @param[in] ZLIM + !> + !> @author F. Ardhuin + !> @date 30-Aug-2012 + !> SUBROUTINE UG_GETOPENBOUNDARY(TMPSTA,ZBIN,ZLIM) !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -796,6 +876,17 @@ END SUBROUTINE UG_GETOPENBOUNDARY !/---------------------------------------------------------------------- + + !> + !> @brief Calculates triangle areas and reorders the triangles to have + !> them oriented counterclockwise. + !> + !> @details The triangle surface calculation is based on cross product. + !> + !> @author A. Roland + !> @author F. Ardhuin + !> @date 31-Aug-2011 + !> SUBROUTINE SPATIAL_GRID !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -902,6 +993,16 @@ END SUBROUTINE SPATIAL_GRID !/--------------------------------------------------------------------/ ! !/--------------------------------------------------------------------/ + + !> + !> @brief Calculate cell tools: inward normal, angles and length of edges. + !> + !> @details To get inward pointing normals, triangle are glanced through + !> anti-clockwisely. + !> + !> @author A. Roland + !> @date 15-May-2008 + !> SUBROUTINE NVECTRI !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -1023,8 +1124,17 @@ END SUBROUTINE NVECTRI !/------------------------------------------------------------------------ + !> + !> @brief Calculate global and maximum number of connection for array + !> allocations. + !> + !> @param[in] TRIGPTEMP Temporary array of triangle vertices. + !> + !> @author A. Roland + !> @author F. Ardhuin + !> @date 15-May-2008 + !> SUBROUTINE COUNT(TRIGPTEMP) - !/ ------------------------------------------------------------------- !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -1130,6 +1240,14 @@ SUBROUTINE COUNT(TRIGPTEMP) END SUBROUTINE COUNT !/---------------------------------------------------------------------------- + + !> + !> @brief Calculate first point and last point coordinates, and minimum and + !> maximum edge length. + !> + !> @author F. Ardhuin + !> @date 15-May-2008 + !> SUBROUTINE COORDMAX !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -1202,6 +1320,22 @@ SUBROUTINE COORDMAX END SUBROUTINE COORDMAX !------------------------------------------------------------------------- + !> + !> @brief Define optimized connection arrays (points and triangles) for + !> spatial propagation schemes. + !> + !> @details The storage is optimize especially considering the iterative solver used. + !> The schemes used are vertex-centered, a point has to be considered within its + !> median dual cell. For a given point, the surface of the dual cell is one third + !> of the sum of the surface of connected triangles. + !> + !> This routine is from WWM developped in Darmstadt(Aaron Roland). + !> + !> @param[in] IMOD Model number to point to. + !> + !> @author A. Roland + !> @date 23-Aug-2011 + !> SUBROUTINE AREA_SI(IMOD) !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -1452,6 +1586,30 @@ SUBROUTINE AREA_SI(IMOD) END SUBROUTINE AREA_SI + !> + !> @brief Determine whether a point is inside or outside an + !> unstructured grid, and returns index of triangle and + !> interpolation weights. + !> + !> @details This is the analogue for triangles of the FUNCTION W3GRMP. + !> + !> Using barycentric coordinates defined as the ratio of triangle + !> algebric areas which are positive or negative. Computes the 3 + !> interpolation weights for each triangle until they are all positive. + !> + !> @param[in] IMOD Model number to point to. + !> @param[in] XTIN X-coordinate of target point. + !> @param[in] YTIN Y-coordinate of target point. + !> @param[out] ITOUT Model number to point to. + !> @param[out] IS I indices of vertices of enclosing grid cell. + !> @param[out] JS J indices of vertices of enclosing grid cell. + !> @param[out] RW Array of interpolation weights. + !> + !> @author Mathieu Dutour Sikiric, IRB + !> @author Aron Roland, Z&P + !> @author Fabrice Ardhuin + !> @date 26-Jan-2014 + !> SUBROUTINE IS_IN_UNGRID(IMOD, XTIN, YTIN, ITOUT, IS, JS, RW) !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -1628,6 +1786,32 @@ SUBROUTINE IS_IN_UNGRID(IMOD, XTIN, YTIN, ITOUT, IS, JS, RW) ENDDO END SUBROUTINE IS_IN_UNGRID !/ ------------------------------------------------------------------- + + !> + !> @brief Determine whether a point is inside or outside an + !> unstructured grid, and returns index of triangle and + !> interpolation weights. + !> + !> @details This is the analogue for triangles of the FUNCTION W3GRMP. + !> + !> Using barycentric coordinates defined as the ratio of triangle + !> algebric areas which are positive or negative. Computes the 3 + !> interpolation weights for each triangle until they are all positive. + !> + !> @param[in] IMOD Model number to point to. + !> @param[in] XTIN X-coordinate of target point. + !> @param[in] YTIN Y-coordinate of target point. + !> @param[in] FORCE + !> @param[out] ITOUT Model number to point to. + !> @param[out] IS I indices of vertices of enclosing grid cell. + !> @param[out] JS J indices of vertices of enclosing grid cell. + !> @param[out] RW Array of interpolation weights. + !> + !> @author Mathieu Dutour Sikiric, IRB + !> @author Aron Roland, Z&P + !> @author Fabrice Ardhuin + !> @date 26-Jan-2014 + !> SUBROUTINE IS_IN_UNGRID2(IMOD, XTIN, YTIN, FORCE, ITOUT, IS, JS, RW) !/ ------------------------------------------------------------------- !/ +-----------------------------------+ @@ -1845,6 +2029,21 @@ SUBROUTINE IS_IN_UNGRID2(IMOD, XTIN, YTIN, FORCE, ITOUT, IS, JS, RW) ENDIF END SUBROUTINE IS_IN_UNGRID2 !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate gradients at a point via its connection. + !> + !> @details Using linear shape function this is a basis on which + !> all advection schemes in Roland (2008) are checked. + !> + !> @param[in] PARAM Depth or current field (indices 0 to NSEA). + !> @param[out] DIFFX X gradient (indices 1 to NX). + !> @param[out] DIFFY Y gradient (indices 1 to NY). + !> + !> @author F. Ardhuin + !> @author A. Roland + !> @date 14-Oct-2013 + !> SUBROUTINE UG_GRADIENTS (PARAM, DIFFX, DIFFY) !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -1979,6 +2178,17 @@ SUBROUTINE UG_GRADIENTS (PARAM, DIFFX, DIFFY) ! END SUBROUTINE UG_GRADIENTS !/ ------------------------------------------------------------------- / + + !> + !> @brief UGTYPE nesting initialization. + !> + !> @param[in] DISTMIN + !> @param[inout] FLOK + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE W3NESTUG(DISTMIN,FLOK) !/ !/ +-----------------------------------+ @@ -2103,6 +2313,17 @@ END SUBROUTINE W3NESTUG !/ ------------------------------------------------------------------- / + + !> + !> @brief Setup boundary pointer. + !> + !> @param[inout] MASK + !> @param[inout] STATUS + !> + !> @author Aron Roland + !> @author Mathiew Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE SET_IOBP (MASK, STATUS) !/ !/ +-----------------------------------+ @@ -2250,6 +2471,20 @@ SUBROUTINE SET_IOBP (MASK, STATUS) END SUBROUTINE SET_IOBP !/ ------------------------------------------------------------------- / + !> + !> @brief Find boundary points. + !> + !> @param[in] MNP + !> @param[in] MNE + !> @param[in] TRIGP + !> @param[inout] IOBP + !> @param[inout] NEIGHBOR_PREV + !> @param[inout] NEIGHBOR_NEXT + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE GET_BOUNDARY(MNP, MNE, TRIGP, IOBP, NEIGHBOR_PREV, & & NEIGHBOR_NEXT) !/ @@ -2479,6 +2714,17 @@ END SUBROUTINE GET_BOUNDARY !/ ------------------------------------------------------------------- / + !> + !> @brief Set indices of the triangle. + !> + !> @param[in] I + !> @param[out] INEXT + !> @param[out] IPREV + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE TRIANG_INDEXES(I, INEXT, IPREV) !/ !/ +-----------------------------------+ @@ -2560,6 +2806,13 @@ END SUBROUTINE TRIANG_INDEXES !/ ------------------------------------------------------------------- / + !> + !> @brief Get interface nodes of the wetting and drying part. + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE GET_INTERFACE() !/ !/ +-----------------------------------+ @@ -2665,6 +2918,17 @@ SUBROUTINE GET_INTERFACE() END SUBROUTINE GET_INTERFACE !/ ------------------------------------------------------------------- / + + !> + !> @brief Redefines the values of the boundary points and angle pointers + !> based on the MAPSTA array. + !> + !> @details Adapted boundary detection from A. Roland and M. Dutour (WWM code). + !> + !> @author Fabrice Ardhuin + !> @author Aron Roland + !> @date 17-Apr-2016 + !> SUBROUTINE SET_UG_IOBP() !/ !/ +-----------------------------------+ @@ -2895,6 +3159,24 @@ SUBROUTINE SET_UG_IOBP() END SUBROUTINE SET_UG_IOBP !/ ------------------------------------------------------------------- / + !> + !> @brief Adjust element longitude coordinates for elements straddling the + !> dateline with distance of ~360 degrees. + !> + !> @details Detect if element has nodes on both sides of dateline and adjust + !> coordinates so that all nodes have the same sign. + !> + !> @param[in] I1 + !> @param[in] I2 + !> @param[in] I3 + !> @param[in] XGRD + !> @param[in] YGRD + !> @param[out] PT + !> + !> @author Steven Brus + !> @author Ali Abdolali + !> @date 21-May-2020 + !> SUBROUTINE FIX_PERIODCITY(I1,I2,I3,XGRD,YGRD,PT) !/ !/ +-----------------------------------+ From e907a02d38ecc603b2209e5f5588ff38aef33885 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 09:40:04 -0400 Subject: [PATCH 09/22] w3src3md.F90: add doxygen markup --- model/src/w3src3md.F90 | 154 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/model/src/w3src3md.F90 b/model/src/w3src3md.F90 index b08b455606..86b9aa69d4 100644 --- a/model/src/w3src3md.F90 +++ b/model/src/w3src3md.F90 @@ -1,5 +1,32 @@ +!> @file +!> @brief The 'WAM4+' source terms based on P.A.E.M. Janssen's work, with +!> extensions by him and by J.-R. Bidlot. +!> +!> @author F. Ardhuin +!> @author H. L. Tolman +!> @date 02-Sep-2012 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief The 'WAM4+' source terms based on P.A.E.M. Janssen's work, with +!> extensions by him and by J.-R. Bidlot. +!> +!> @details Converted from the original WAM codes by F. Ardhuin, +!> with further extensions to adapt to a saturation-based breaking +!> and observation-based swell dissipation. +!> +!> @author F. Ardhuin +!> @author H. L. Tolman +!> @date 02-Sep-2012 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> MODULE W3SRC3MD !/ !/ +-----------------------------------+ @@ -75,6 +102,35 @@ MODULE W3SRC3MD !/ CONTAINS !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate mean wave parameters for the use in the source term + !> routines. + !> + !> @param[in] A Action density spectrum. + !> @param[in] CG Group velocities. + !> @param[in] WN Wavenumbers. + !> @param[out] EMEAN Energy. + !> @param[out] FMEAN Mean frequency for determination of tail. + !> @param[out] FMEANS Mean frequency for dissipation source term. + !> @param[out] WNMEAN Mean wavenumber. + !> @param[out] AMAX Maximum of action spectrum. + !> @param[in] U Wind speed. + !> @param[in] UDIR Wind direction. + !> @param[inout] USTAR Friction velocity + !> @param[inout] USDIR Wind stress direction. + !> @param[in] TAUWX Component of wave-supported stress. + !> @param[in] TAUWY Component of wave-supported stress. + !> @param[out] CD Drag coefficient at wind level ZWND. + !> @param[out] Z0 Corresponding z0. + !> @param[out] CHARN + !> @param[in] LLWS Wind sea true/false array for each component. + !> @param[out] FMEANWS Mean frequency of wind sea, used for tail. + !> + !> @author F. Ardhuin + !> @author H. L. Tolman + !> @date 17-Oct-2007 + !> SUBROUTINE W3SPR3 (A, CG, WN, EMEAN, FMEAN, FMEANS, WNMEAN, & AMAX, U, UDIR, USTAR, USDIR, TAUWX, TAUWY, CD, Z0,& CHARN, LLWS, FMEANWS) @@ -290,6 +346,37 @@ SUBROUTINE W3SPR3 (A, CG, WN, EMEAN, FMEAN, FMEANS, WNMEAN, & !/ END SUBROUTINE W3SPR3 !/ ------------------------------------------------------------------- / + + !> + !> @brief + !> + !> @details + !> + !> @param[in] A Action density spectrum (1-D). + !> @param[in] CG Group speed. + !> @param[in] K Wavenumber for entire spectrum. + !> @param[in] U Wind speed. + !> @param[in] USTAR Friction velocity. + !> @param[in] DRAT Air/water density ratio. + !> @param[in] AS Air-sea temperature difference. + !> @param[in] USDIR Wind stress direction. + !> @param[in] Z0 Air-sea roughness length. + !> @param[in] CD Wind drag coefficient. + !> @param[out] TAUWX Component of the wave-supported stress. + !> @param[out] TAUWY Component of the wave-supported stress. + !> @param[out] TAUWNX Component of the negative wave-supported stress. + !> @param[out] TAUWNY Component of the negative wave-supported stress. + !> @param[in] ICE Sea ice fraction. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative. + !> @param[out] LLWS Wind sea true/false array for each component. + !> @param[in] IX + !> @param[in] IY + !> + !> @author F. Ardhuin + !> @author H. L. Tolman + !> @date 02-Sep-2012 + !> SUBROUTINE W3SIN3 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & TAUWX, TAUWY, TAUWNX, TAUWNY, ICE, S, D, LLWS, IX, IY) !/ @@ -625,6 +712,13 @@ SUBROUTINE W3SIN3 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & !/ END SUBROUTINE W3SIN3 !/ ------------------------------------------------------------------- / + + !> + !> @brief Initialization for source term routine. + !> + !> @author F. Ardhuin + !> @date 23-Jul-2009 + !> SUBROUTINE INSIN3 !/ !/ +-----------------------------------+ @@ -714,6 +808,13 @@ SUBROUTINE INSIN3 !/ END SUBROUTINE INSIN3 ! ---------------------------------------------------------------------- + + !> + !> @brief To generate the friction velocity table, TAUT(TAUW,U10)=SQRT(TAU). + !> + !> @author F. Ardhuin + !> @date 17-Oct-2007 + !> SUBROUTINE TABU_STRESS !/ !/ +-----------------------------------+ @@ -837,6 +938,19 @@ SUBROUTINE TABU_STRESS RETURN END SUBROUTINE TABU_STRESS !/ ------------------------------------------------------------------- / + + !> + !> @brief Tabulation of the high-frequency wave-supported stress. + !> + !> @details SEE REFERENCE FOR WAVE STRESS CALCULATION. + !> FOR QUASILINEAR EFFECT SEE PETER A.E.M. JANSSEN,1990. + !> See tech. Memo ECMWF 03 december 2003 by Bidlot & Janssen. + !> + !> @param[in] FRMAX Maximum frequency. + !> + !> @author F. Ardhuin + !> @date 14-Aug-2006 + !> SUBROUTINE TABU_TAUHF(FRMAX) !/ !/ +-----------------------------------+ @@ -999,6 +1113,21 @@ END SUBROUTINE TABU_TAUHF !/ ------------------------------------------------------------------- / !/ ------------------------------------------------------------------- / + + !> + !> @brief Compute friction velocity based on wind speed U10. + !> + !> @details Computation of u* based on Quasi-linear theory. + !> + !> @param[in] WINDSPEED 10-m wind speed ... should be NEUTRAL + !> @param[in] TAUW Wave-supported stress. + !> @param[out] USTAR Friction velocity. + !> @param[out] Z0 Air-side roughness length. + !> @param[out] CHARN + !> + !> @author F. Ardhuin + !> @date 14-Aug-2006 + !> SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) !/ !/ +-----------------------------------+ @@ -1093,6 +1222,31 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) RETURN END SUBROUTINE CALC_USTAR !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate whitecapping source term and diagonal term of derivative. + !> + !> @details WAM-Cycle 4 and following. + !> The last update (09-May-2005) follows the redefinition of + !> the mean wavenumber as in Bidlot et al. (2005). + !> + !> @param[in] A Action density spectrum (1-D). + !> @param[in] K Wavenumber for entire spectrum. + !> @param[in] CG + !> @param[in] EMEAN Mean wave energy. + !> @param[in] FMEAN Mean wave frequency. + !> @param[in] WNMEAN Mean wavenumber. + !> @param[in] USTAR Friction velocity. + !> @param[in] USDIR Wind stress direction. + !> @param[in] DEPTH Water depth. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative. + !> @param[in] IX + !> @param[in] IY + !> + !> @author F. Ardhuin + !> @date 23-Jul-2009 + !> SUBROUTINE W3SDS3 (A, K, CG, EMEAN, FMEAN, WNMEAN, USTAR, USDIR, & DEPTH, S, D, IX, IY) !/ From 487305c7f2bedd5b64e0d872e1c3df6c9259bef8 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 13:33:05 -0400 Subject: [PATCH 10/22] w3src4md.F90: add doxygen markup --- model/src/w3src4md.F90 | 185 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/model/src/w3src4md.F90 b/model/src/w3src4md.F90 index 004b4708f0..73587c2a7c 100644 --- a/model/src/w3src4md.F90 +++ b/model/src/w3src4md.F90 @@ -1,5 +1,30 @@ +!> @file +!> @brief The 'SHOM/Ifremer' source terms based on P.A.E.M. +!> +!> @author F. Ardhuin +!> @date 13-Nov-2013 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief The 'SHOM/Ifremer' source terms based on P.A.E.M. +!> +!> @details Janssen's wind input +!> and dissipation functions by Ardhuin et al. (2009,2010) +!> and Filipot & Ardhuin (2010) +!> The wind input is converted from the original +!> WAM codes, courtesy of P.A.E.M. Janssen and J. Bidlot +!> +!> @author F. Ardhuin +!> @date 13-Nov-2013 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> MODULE W3SRC4MD !/ !/ +-----------------------------------+ @@ -82,6 +107,39 @@ MODULE W3SRC4MD !/ CONTAINS !/ ------------------------------------------------------------------- / + +!> +!> @brief Calculate mean wave parameters for the use in the source term +!> routines. +!> +!> @param[in] A Action density spectrum. +!> @param[in] CG Group velocities. +!> @param[in] WN Wavenumbers. +!> @param[out] EMEAN Energy. +!> @param[out] FMEAN Mean frequency for determination of tail. +!> @param[out] FMEAN1 Mean frequency (fm0,-1) used for reflection. +!> @param[out] WNMEAN Mean wavenumber. +!> @param[out] AMAX Maximum of action spectrum. +!> @param[in] U Wind speed. +!> @param[in] UDIR Wind direction. +!> @param[in] TAUA Atm total stress. +!> @param[in] TAUADIR Atm total stress direction. +!> @param[in] DAIR Air density. +!> @param[inout] USTAR Friction velocity. +!> @param[inout] USDIR Wind stress direction. +!> @param[in] TAUWX Component of wave-supported stress. +!> @param[in] TAUWY Component of wave-supported stress. +!> @param[out] CD Drag coefficient at wind level ZWND. +!> @param[out] Z0 Corresponding z0. +!> @param[out] CHARN Corresponding Charnock coefficient. +!> @param[in] LLWS Wind sea true/false array for each component. +!> @param[out] FMEANWS Mean frequency of wind sea, used for tail. +!> @param[out] DLWMEAN Mean Long wave direction (L. Romero 2019). +!> +!> @author F. Ardhuin +!> @author H. L. Tolman +!> @date 22-Feb-2020 +!> SUBROUTINE W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, & AMAX, U, UDIR, & #ifdef W3_FLX5 @@ -326,6 +384,43 @@ SUBROUTINE W3SPR4 (A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, & !/ END SUBROUTINE W3SPR4 !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate diagonal and input source term for WAM4+ approach. + !> + !> @verbatim + !> WAM-4 : Janssen et al. + !> WAM-"4.5" : gustiness effect (Cavaleri et al. ) + !> SAT : high-frequency input reduction for balance with + !> saturation dissipation (Ardhuin et al., 2008) + !> SWELL : negative wind input (Ardhuin et al. 2008) + !> @endverbatim + !> + !> @param[in] A Action density spectrum (1-D). + !> @param[in] CG Group speed. + !> @param[in] K Wavenumber for entire spectrum. + !> @param[in] U Wind speed. + !> @param[in] USTAR Friction velocity. + !> @param[in] DRAT Air/water density ratio. + !> @param[in] AS Air-sea temperature difference. + !> @param[in] USDIR Wind stress direction. + !> @param[in] Z0 Air-sea roughness length. + !> @param[in] CD Wind drag coefficient. + !> @param[out] TAUWX Component of the wave-supported stress. + !> @param[out] TAUWY Component of the wave-supported stress. + !> @param[out] TAUWNX Component of the negative wave-supported stress. + !> @param[out] TAUWNY Component of the negative wave-supported stress. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative. + !> @param[out] LLWS + !> @param[in] IX + !> @param[in] IY + !> @param[in] BRLAMBDA + !> + !> @author F. Ardhuin + !> @author H. L. Tolman + !> @date 05-Dec-2013 + !> SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & TAUWX, TAUWY, TAUWNX, TAUWNY, S, D, LLWS, & IX, IY, BRLAMBDA) @@ -779,6 +874,15 @@ SUBROUTINE W3SIN4 (A, CG, K, U, USTAR, DRAT, AS, USDIR, Z0, CD, & !/ END SUBROUTINE W3SIN4 !/ ------------------------------------------------------------------- / + + !> + !> @brief Initialization for source term routine. + !> + !> @param[in] FLTABS + !> + !> @author F. Ardhuin + !> @date 30-Aug-2010 + !> SUBROUTINE INSIN4(FLTABS) !/ !/ +-----------------------------------+ @@ -1043,6 +1147,13 @@ SUBROUTINE INSIN4(FLTABS) !/ END SUBROUTINE INSIN4 ! ---------------------------------------------------------------------- + + !> + !> @brief To generate friction velocity table TAUT(TAUW,U10)=SQRT(TAU). + !> + !> @author F. Ardhuin + !> @date 17-Oct-2007 + !> SUBROUTINE TABU_STRESS !/ !/ +-----------------------------------+ @@ -1166,6 +1277,20 @@ SUBROUTINE TABU_STRESS RETURN END SUBROUTINE TABU_STRESS !/ ------------------------------------------------------------------- / + + !> + !> @brief Tabulation of the high-frequency wave-supported stress. + !> + !> @details SEE REFERENCE FOR WAVE STRESS CALCULATION. + !> FOR QUASILINEAR EFFECT SEE PETER A.E.M. JANSSEN,1990. + !> See tech. Memo ECMWF 03 december 2003 by Bidlot & Janssen. + !> + !> + !> @param[in] SIGMAX Maximum frequency * TPI. + !> + !> @author F. Ardhuin + !> @date 14-Aug-2006 + !> SUBROUTINE TABU_TAUHF(SIGMAX) !/ !/ +-----------------------------------+ @@ -1321,6 +1446,21 @@ SUBROUTINE TABU_TAUHF(SIGMAX) END SUBROUTINE TABU_TAUHF !/ ------------------------------------------------------------------- / + + !> + !> @brief Tabulation of the high-frequency wave-supported stress as + !> a function of ustar, alpha (modified Charnock), and tail energy + !> level. + !> + !> @details SEE REFERENCE FOR WAVE STRESS CALCULATION. + !> FOR QUASILINEAR EFFECT SEE PETER A.E.M. JANSSEN,1990. + !> See tech. Memo ECMWF 03 december 2003 by Bidlot & Janssen + !> + !> @param[in] SIGMAX Maximum frequency*TPI. + !> + !> @author F. Ardhuin + !> @date 24-Jan-2013 + !> SUBROUTINE TABU_TAUHF2(SIGMAX) !/ !/ +-----------------------------------+ @@ -1549,6 +1689,21 @@ SUBROUTINE TABU_TAUHF2(SIGMAX) END SUBROUTINE TABU_TAUHF2 !/ ------------------------------------------------------------------- / + + !> + !> @brief Compute friction velocity based on wind speed U10. + !> + !> @details Computation of u* based on Quasi-linear theory. + !> + !> @param[in] WINDSPEED 10-m wind speed -- should be NEUTRAL. + !> @param[in] TAUW Wave-supported stress. + !> @param[out] USTAR Friction velocity. + !> @param[out] Z0 Air-side roughness length. + !> @param[out] CHARN Charnock. + !> + !> @author F. Ardhuin + !> @date 14-Aug-2006 + !> SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) !/ !/ +-----------------------------------+ @@ -1652,6 +1807,36 @@ SUBROUTINE CALC_USTAR(WINDSPEED,TAUW,USTAR,Z0,CHARN) RETURN END SUBROUTINE CALC_USTAR !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate whitecapping source term and diagonal term of derivative. + !> + !> @details This codes does either one or the other of + !> Ardhuin et al. (JPO 2010) + !> Filipot & Ardhuin (JGR 2012) + !> Romero (GRL 2009) + !> the choice depends on SDSBCHOICE + !> + !> @param[in] A Action density spectrum (1-D). + !> @param[in] K Wavenumber for entire spectrum. + !> @param[in] CG Group velocity. + !> @param[in] USTAR Friction velocity. + !> @param[in] USDIR Wind stress direction. + !> @param[in] DEPTH Water depth. + !> @param[in] DAIR Air density. + !> @param[out] SRHS + !> @param[out] DDIAG + !> @param[in] IX Grid Index. + !> @param[in] IY Grid Index. + !> @param[out] BRLAMBDA Phillips' Lambdas. + !> @param[out] WHITECAP + !> @param[in] DLWMEAN + !> + !> @author F. Ardhuin + !> @author F. Leckler + !> @author L. Romero + !> @date 13-Aug-2021 + !> SUBROUTINE W3SDS4 (A, K, CG, USTAR, USDIR, DEPTH, DAIR, SRHS, & DDIAG, IX, IY, BRLAMBDA, WHITECAP, DLWMEAN ) !/ From 4deb777c0b4583a0b16ad916938aecf73c9c5367 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 14:24:25 -0400 Subject: [PATCH 11/22] w3src6md.F90: add doxygen markup --- model/src/w3src6md.F90 | 177 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) diff --git a/model/src/w3src6md.F90 b/model/src/w3src6md.F90 index 433977991b..4378afec1b 100644 --- a/model/src/w3src6md.F90 +++ b/model/src/w3src6md.F90 @@ -1,5 +1,29 @@ +!> @file +!> @brief Observation-based wind input and dissipation after Donelan et al (2006), +!> and Babanin et al. (2010). +!> +!> @author S. Zieger +!> @author Q. Liu +!> @date 26-Jun-2018 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> @brief Observation-based wind input and dissipation after Donelan et al (2006), +!> and Babanin et al. (2010). +!> +!> @details Parameterisation is based on the field +!> data from Lake George, Australia. Initial implementation of input +!> and dissipation is based on work from Tsagareli et al. (2010) and +!> Rogers et al. (2012). Parameterisation extended and account for +!> negative input due to opposing winds (see Donelan et al, 2006) and +!> the vector version of the stress computation. +!> +!> @author S. Zieger +!> @author Q. Liu +!> @date 26-Jun-2018 +!> MODULE W3SRC6MD !/ !/ +-----------------------------------+ @@ -76,6 +100,24 @@ MODULE W3SRC6MD PRIVATE :: LFACTOR, TAUWINDS, IRANGE CONTAINS !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate mean wave parameters. + !> + !> @details See source term routines. + !> + !> @param[inout] A Action as a function of direction and wavenumber. + !> @param[inout] CG Group velocities. + !> @param[inout] WN Wavenumbers. + !> @param[inout] EMEAN Mean wave energy. + !> @param[inout] FMEAN Mean wave frequency. + !> @param[inout] WNMEAN Mean wavenumber. + !> @param[inout] AMAX Maximum action density in spectrum. + !> @param[inout] FP Peak frequency (rad). + !> + !> @author S. Zieger + !> @date 11-Feb-2011 + !> SUBROUTINE W3SPR6 (A, CG, WN, EMEAN, FMEAN, WNMEAN, AMAX, FP) !/ !/ +-----------------------------------+ @@ -214,6 +256,37 @@ SUBROUTINE W3SPR6 (A, CG, WN, EMEAN, FMEAN, WNMEAN, AMAX, FP) !/ END SUBROUTINE W3SPR6 !/ ------------------------------------------------------------------- / + + !> + !> @brief Observation-based source term for wind input. + !> + !> @details After Donelan, Babanin, Young and Banner (Donelan et al ,2006) + !> following the implementation by Rogers et al. (2012). + !> + !> References: + !> Donelan et al. 2006: JPO 36(8) 1672-1689. + !> Rogers et al. 2012: JTECH 29(9) 1329-1346 + !> + !> + !> @param[in] A Action density spectrum + !> @param[in] CG Group velocities. + !> @param[in] WN2 Wavenumbers. + !> @param[in] UABS Wind speed at 10 m above sea level (U10). + !> @param[in] USTAR Friction velocity. + !> @param[in] USDIR Direction of USTAR. + !> @param[in] CD Drag coefficient. + !> @param[in] DAIR Air density. + !> @param[out] TAUWX Component of the wave-supported stress. + !> @param[out] TAUWY Component of the wave-supported stress. + !> @param[out] TAUWNX Component of the negative part of the stress. + !> @param[out] TAUWNY Component of the negative part of the stress. + !> @param[out] S Source term. + !> @param[out] D Diagonal term of derivative. + !> + !> @author S. Zieger + !> @author Q. Liu + !> @date 13-Aug-2021 + !> SUBROUTINE W3SIN6 (A, CG, WN2, UABS, USTAR, USDIR, CD, DAIR, & TAUWX, TAUWY, TAUNWX, TAUNWY, S, D ) !/ @@ -445,6 +518,31 @@ SUBROUTINE W3SIN6 (A, CG, WN2, UABS, USTAR, USDIR, CD, DAIR, & !/ END SUBROUTINE W3SIN6 !/ ------------------------------------------------------------------- / + + !> + !> @brief Observation-based source term for dissipation. + !> + !> @details After Babanin et al. (2010) following the implementation by + !> Rogers et al. (2012). The dissipation function Sds accommodates an + !> inherent breaking term T1 and an additional cumulative term T2 at + !> all frequencies above the peak. The forced dissipation term T2 is + !> an integral that grows toward higher frequencies and dominates at + !> smaller scales (Babanin et al. 2010). + !> + !> References: + !> Babanin et al. 2010: JPO 40(4), 667-683 + !> Rogers et al. 2012: JTECH 29(9) 1329-1346 + !> + !> @param[in] A Action density spectrum. + !> @param[in] CG Group velocities. + !> @param[in] WN Wavenumbers. + !> @param[out] S Source term (1-D version). + !> @param[out] D Diagonal term of derivative. + !> + !> @author S. Zieger + !> @author Q. Liu + !> @date 26-Jun-2018 + !> SUBROUTINE W3SDS6 (A, CG, WN, S, D) !/ !/ +-----------------------------------+ @@ -643,6 +741,31 @@ SUBROUTINE W3SDS6 (A, CG, WN, S, D) END SUBROUTINE W3SDS6 !/ ------------------------------------------------------------------- / !/ + + !> + !> @brief Numerical approximation for the reduction factor. + !> + !> @details Numerical approximation for the reduction factor LFACTOR(f) to + !> reduce energy in the high-frequency part of the resolved part + !> of the spectrum to meet the constraint on total stress (TAU). + !> The constraint is TAU <= TAU_TOT (TAU_TOT = TAU_WAV + TAU_VIS), + !> thus the wind input is reduced to match our constraint. + !> + !> @param[in] S Wind input energy density spectrum. + !> @param[in] CINV Inverse phase speed. + !> @param[in] U10 Wind speed. + !> @param[in] USTAR Friction velocity. + !> @param[in] USDIR Wind direction. + !> @param[in] SIG Relative frequencies (in rad.). + !> @param[in] DSII Frequency bandwidths (in rad.). + !> @param[out] LFACT Factor array. + !> @param[out] TAUWX Component of the wave-supported stress. + !> @param[out] TAUWY Component of the wave-supported stress. + !> + !> @author S. Zieger + !> @author Q. Liu + !> @date 26-Jun-2018 + !> SUBROUTINE LFACTOR(S, CINV, U10, USTAR, USDIR, SIG, DSII, & LFACT, TAUWX, TAUWY ) !/ @@ -921,6 +1044,25 @@ SUBROUTINE LFACTOR(S, CINV, U10, USTAR, USDIR, SIG, DSII, & END SUBROUTINE LFACTOR !/ ------------------------------------------------------------------- / !/ + + !> + !> @brief Calculated the stress for the negative part of the input term. + !> + !> @details Calculated the stress for the negative part of the input term, + !> that is the stress from the waves to the atmosphere. Relevant + !> in the case of opposing winds. + !> + !> @param[in] S Wind-input source term Sin. + !> @param[in] CINV Inverse phase speed. + !> @param[in] SIG Relative frequencies. + !> @param[in] DSII Frequency bandwidths. + !> @param[out] TAUNWX Stress components (wave->atmos). + !> @param[out] TAUNWY Stress components (wave->atmos). + !> + !> @author S. Zieger + !> @author Q. Liu + !> @date 26-Jun-2018 + !> SUBROUTINE TAU_WAVE_ATMOS(S, CINV, SIG, DSII, TAUNWX, TAUNWY ) !/ !/ +-----------------------------------+ @@ -1055,6 +1197,20 @@ SUBROUTINE TAU_WAVE_ATMOS(S, CINV, SIG, DSII, TAUNWX, TAUNWY ) END SUBROUTINE TAU_WAVE_ATMOS !/ ------------------------------------------------------------------- / !/ + + !> + !> @brief Generate a sequence of linear-spaced integer numbers. + !> + !> @details Used for instance array addressing (indexing). + !> + !> @param X0 + !> @param X1 + !> @param DX + !> @returns IX + !> + !> @author S. Zieger + !> @date 15-Feb-2011 + !> FUNCTION IRANGE(X0,X1,DX) RESULT(IX) !/ !/ +-----------------------------------+ @@ -1087,6 +1243,27 @@ FUNCTION IRANGE(X0,X1,DX) RESULT(IX) END FUNCTION IRANGE !/ ------------------------------------------------------------------- / !/ + + !> + !> @brief Wind stress (tau) computation from wind-momentum-input. + !> + !> @verbatim + !> Wind stress (tau) computation from wind-momentum-input + !> function which can be obtained from wind-energy-input (Sin). + !> + !> / FRMAX + !> tau = g * rho_water * | Sin(f)/C(f) df + !> / + !> @endverbatim + !> + !> @param SDENSIG Sin(sigma) in (m2/rad-Hz). + !> @param CINV Inverse phase speed. + !> @param DSII Frequency bandwidths in (rad). + !> @returns TAU_WINDS Wind stress. + !> + !> @author S. Zieger + !> @date 13-Aug-2012 + !> FUNCTION TAUWINDS(SDENSIG,CINV,DSII) RESULT(TAU_WINDS) !/ !/ +-----------------------------------+ From 8dacc3463c852abdc66ea6eaf78f78cf113b1ecc Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 16:30:28 -0400 Subject: [PATCH 12/22] w3srcemd.F90: add doxygen markup --- model/src/w3srcemd.F90 | 176 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) diff --git a/model/src/w3srcemd.F90 b/model/src/w3srcemd.F90 index 1f4f0268d5..c03aca04a5 100644 --- a/model/src/w3srcemd.F90 +++ b/model/src/w3srcemd.F90 @@ -1,5 +1,26 @@ +!> @file +!> @brief Source term integration routine. +!> +!> @author H. L. Tolman +!> @author F. Ardhuin +!> @date 22-Mar-2021 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Source term integration routine. +!> +!> @author H. L. Tolman +!> @author F. Ardhuin +!> @date 22-Mar-2021 +!> +!> @copyright Copyright 2009-2022 National Weather Service (NWS), +!> National Oceanic and Atmospheric Administration. All rights +!> reserved. WAVEWATCH III is a trademark of the NWS. +!> No unauthorized use without permission. +!> MODULE W3SRCEMD !/ !/ +-----------------------------------+ @@ -49,6 +70,123 @@ MODULE W3SRCEMD !/ CONTAINS !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate and integrate source terms for a single grid point. + !> + !> @verbatim + !> Physics : see manual and corresponding subroutines. + !> + !> Numerics : + !> + !> Dynamic-implicit integration of the source terms based on + !> WW-II (Tolman 1992). The dynamic time step is calculated + !> given a maximum allowed change of spectral densities for + !> frequencies / wavenumbers below the usual cut-off. + !> The maximum change is given by the minimum of a parametric + !> and a relative change. The parametric change relates to a + !> PM type equilibrium range + !> + !> -1 (2pi)**4 1 + !> dN(k) = Xp alpha pi ---------- ------------ + !> max g**2 k**3 sigma + !> + !> 1 . + !> = FACP ------------ (1) + !> k**3 sigma . + !> + !> where + !> alpha = 0.62e-4 (set in W3GRID) + !> Xp fraction of PM shape (read in W3GRID) + !> FACP combined factor (set in W3GRID) + !> + !> The maximum relative change is given as + !> + !> / +- -+ \ . + !> dN(k) = Xr max | N(k) , max | Nx , Xfilt N(k) | | (2) + !> max \ +- max-+ / . + !> + !> where + !> Xr fraction of relative change (read in W3GRID) + !> Xfilt filter level (read in W3GRID) + !> Nx Maximum parametric change (1) + !> for largest wavenumber. + !> @endverbatim + !> + !> @param[in] srce_call + !> @param[in] IT + !> @param[in] ISEA + !> @param[in] JSEA + !> @param[in] IX Discrete grid point counters. + !> @param[in] IY Discrete grid point counters. + !> @param[in] IMOD Model number. + !> @param[in] SPECOLD + !> @param[inout] SPEC Spectrum (action) in 1-D form. + !> @param[out] VSIO + !> @param[out] VDIO + !> @param[out] SHAVEIO + !> @param[inout] ALPHA Nondimensional 1-D spectrum corresponding + !> to above full spectra (Phillip's const.). + !> @param[inout] WN1 Discrete wavenumbers. + !> @param[inout] CG1 Id. group velocities. + !> @param[in] CLATSL + !> @param[in] D_INP Depth, compared to DMIN to get DEPTH. + !> @param[in] U10ABS Wind speed at reference height. + !> @param[in] U10DIR Id. wind direction. + !> @param[inout] TAUA Magnitude of total atmospheric stress. + !> @param[inout] TAUADIR Direction of atmospheric stress. + !> @param[in] AS Air-sea temperature difference. + !> @param[inout] USTAR Friction velocity. + !> @param[inout] USTDIR Idem, direction. + !> @param[in] CX Current velocity component. + !> @param[in] CY Current velocity component. + !> @param[in] ICE Sea ice concentration. + !> @param[in] ICEH Sea ice thickness. + !> @param[inout] ICEF Sea ice floe diameter. + !> @param[in] ICEDMAX Sea ice maximum floe diameter + !> @param[in] REFLEC Reflection coefficients. + !> @param[in] REFLED Reflection direction. + !> @param[in] DELX Grid cell size in X direction. + !> @param[in] DELY Grid cell size in Y direction. + !> @param[in] DELA Grid cell area. + !> @param[in] TRNX Grid transparency in X. + !> @param[in] TRNY Grid transparency in Y. + !> @param[in] BERG Iceberg damping coefficient. + !> @param[inout] FPI Peak-input frequency. + !> @param[out] DTDYN Average dynamic time step. + !> @param[out] FCUT Cut-off frequency for tail. + !> @param[in] DTG Global time step. + !> @param[inout] TAUWX + !> @param[inout] TAUWY + !> @param[inout] TAUOX + !> @param[inout] TAUWIX + !> @param[inout] TAUWIY + !> @param[inout] TAUWNX + !> @param[inout] TAUWNY + !> @param[inout] PHIAW + !> @param[inout] CHARN + !> @param[inout] TWS + !> @param[inout] PHIOC + !> @param[inout] WHITECAP Whitecap statistics. + !> @param[in] D50 Sand grain size. + !> @param[in] PSIC Critical shields. + !> @param[inout] BEDFORM Bedform parameters. + !> @param[inout] PHIBBL Energy flux to BBL. + !> @param[inout] TAUBBL Momentum flux to BBL. + !> @param[inout] TAUICE Momentum flux to sea ice. + !> @param[inout] PHICE Energy flux to sea ice. + !> @param[inout] TAUOCX Total ocean momentum component. + !> @param[inout] TAUOCY Total ocean momentum component. + !> @param[inout] WNMEAN Mean wave number. + !> @param[in] DAIR Air density. + !> @param[in] COEF + !> + !> @author H. L. Tolman + !> @author F. Ardhuin + !> @author A. Roland + !> @author M. Dutour Sikiric + !> @date 22-Mar-2021 + !> SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & SPECOLD, SPEC, VSIO, VDIO, SHAVEIO, & ALPHA, WN1, CG1, CLATSL, & @@ -2194,6 +2332,20 @@ SUBROUTINE W3SRCE ( srce_call, IT, ISEA, JSEA, IX, IY, IMOD, & !/ END SUBROUTINE W3SRCE !/ ------------------------------------------------------------------- / + + !> + !> @brief Calculate equivalent peak frequency. + !> + !> @details Tolman and Chalikov (1996), equivalent peak frequency from source. + !> + !> @param[in] A Action density spectrum (1-D). + !> @param[in] CG Group velocities for k-axis of spectrum. + !> @param[out] FPI Input 'peak' frequency. + !> @param[in] S Source term (1-D version). + !> + !> @author Jessica Meixner + !> @date 06-Jun-2018 + !> SUBROUTINE CALC_FPI( A, CG, FPI, S ) !/ !/ +-----------------------------------+ @@ -2313,6 +2465,18 @@ SUBROUTINE CALC_FPI( A, CG, FPI, S ) END SUBROUTINE CALC_FPI !/ ------------------------------------------------------------------- /! + + !> + !> @brief Put source term in matrix same as done always. + !> + !> @param[in] SPEC + !> @param[inout] VS + !> @param[inout] VD + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE SIGN_VSD_SEMI_IMPLICIT_WW3(SPEC, VS, VD) !/ !/ +-----------------------------------+ @@ -2389,6 +2553,18 @@ SUBROUTINE SIGN_VSD_SEMI_IMPLICIT_WW3(SPEC, VS, VD) END DO END SUBROUTINE SIGN_VSD_SEMI_IMPLICIT_WW3 !/ ------------------------------------------------------------------- / + + !> + !> @brief Put source term in matrix Patankar style (experimental). + !> + !> @param[in] SPEC + !> @param[inout] VS + !> @param[inout] VD + !> + !> @author Aron Roland + !> @author Mathieu Dutour-Sikiric + !> @date 01-Jun-2018 + !> SUBROUTINE SIGN_VSD_PATANKAR_WW3(SPEC, VS, VD) !/ !/ +-----------------------------------+ From a1d4ccc9b3eef41553bc19fb54c79285d75bc415 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 16:51:14 -0400 Subject: [PATCH 13/22] ww3_gspl.F90: fix spelling --- model/src/ww3_gspl.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/ww3_gspl.F90 b/model/src/ww3_gspl.F90 index dab308fd5d..5fb8750b19 100644 --- a/model/src/ww3_gspl.F90 +++ b/model/src/ww3_gspl.F90 @@ -2113,7 +2113,7 @@ END SUBROUTINE GRSQRG !> @brief Remove seapoints with only one adjacent point in same grid. !> !> @details Remove points from a grid that are in the middle of the - !> sea, but that have omly one adjacent point in the same grid. Directly + !> sea, but that have only one adjacent point in the same grid. Directly !> select a new grid for this point rather than deactivate and use !> GRFILL. !> From 9a999be9e6496a2ef68a50ee85509d12a7eb7461 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 16:52:30 -0400 Subject: [PATCH 14/22] w3updtmd.F90: fix doxygen tag, @attn -> @attention --- model/src/w3updtmd.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/src/w3updtmd.F90 b/model/src/w3updtmd.F90 index 72fdae7b20..01cf9fd87f 100644 --- a/model/src/w3updtmd.F90 +++ b/model/src/w3updtmd.F90 @@ -1501,7 +1501,7 @@ SUBROUTINE W3UBPT !/ END SUBROUTINE W3UBPT !/ ------------------------------------------------------------------- / - !> @attn FLFRST not used. + !> @attention FLFRST not used. !> @brief Update ice thickness in the wave model. !> !> @param[in] FLFRST @@ -1612,7 +1612,7 @@ SUBROUTINE W3UIC1( FLFRST ) END SUBROUTINE W3UIC1 !/ ------------------------------------------------------------------- / - !> @attn FLFRST not currently used. + !> @attention FLFRST not currently used. !> @brief Update ice floe mean and max diameters in the wave model. !> !> @param[in] FLFRST From a1f379ad8cda771d4579277947bb7b7d19ac5c29 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 16:59:24 -0400 Subject: [PATCH 15/22] ww3_gspl.F90: fix spelling, intent attribute --- model/src/ww3_gspl.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/src/ww3_gspl.F90 b/model/src/ww3_gspl.F90 index 5fb8750b19..644f2cf9e0 100644 --- a/model/src/ww3_gspl.F90 +++ b/model/src/ww3_gspl.F90 @@ -2284,11 +2284,11 @@ END SUBROUTINE GRSNGL !> @brief Remove smaller grid parts. !> - !> @details Remove smller parts of a grid that are separated from + !> @details Remove smaller parts of a grid that are separated from !> the main body, and that can be attached to other grids. !> !> @param[inout] OK - !> @param[inout] FRAC Fraction of average size used to remove grid part. + !> @param[in] FRAC Fraction of average size used to remove grid part. !> @author H. L. Tolman @date 01-Feb-2013 SUBROUTINE GRSEPA ( OK, FRAC ) !/ From 045eab45c400f0c21de010044c2ec01cc15b9623 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:04:32 -0400 Subject: [PATCH 16/22] ww3_gspl.F90: grammer fixes --- model/src/ww3_gspl.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/src/ww3_gspl.F90 b/model/src/ww3_gspl.F90 index 644f2cf9e0..fdba21807c 100644 --- a/model/src/ww3_gspl.F90 +++ b/model/src/ww3_gspl.F90 @@ -2630,9 +2630,9 @@ END SUBROUTINE GRSEPA !> @brief Subroutine called when lowest grid size is stuck. !> - !> @details Attempting to joint to neighbor grid, otherwise mark - !> as accepted small grid. note that small grid does not influence - !> parallel scaling like a big grid does ..... + !> @details Attempting to join to neighbor grid, otherwise mark + !> as a accepted small grid. note that a small grid does not + !> influence parallel scaling like a big grid does ..... !> !> @author H. L. Tolman @date 04-Feb-2013 SUBROUTINE GRFSML From 78ae22bdf92b40b3168ee7501e96dc591bd3bba5 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:14:07 -0400 Subject: [PATCH 17/22] w3updtmd.F90: spelling fix --- model/src/w3updtmd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/w3updtmd.F90 b/model/src/w3updtmd.F90 index 01cf9fd87f..88f500f74a 100644 --- a/model/src/w3updtmd.F90 +++ b/model/src/w3updtmd.F90 @@ -1742,7 +1742,7 @@ END SUBROUTINE W3UIC5 !> @details Points with an ice concentration larger than FICEN are !> removed from the sea map in the wave model. Such points are !> identified by negative numbers is the grid status map MAPSTA. For -!> ice points spectra are set to zero. Points from wich ice disappears +!> ice points spectra are set to zero. Points from which ice disappears !> are initialized with a "small" JONSWAP spectrum, based on the !> frequency SIG(NK-1) and the local wind direction. !> From e986e12b5a7f0d50826ccb81854291d8774d9ac9 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:20:03 -0400 Subject: [PATCH 18/22] w3updtmd.F90: doxygen formatting correction --- model/src/w3updtmd.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/model/src/w3updtmd.F90 b/model/src/w3updtmd.F90 index 88f500f74a..6ccaaeca42 100644 --- a/model/src/w3updtmd.F90 +++ b/model/src/w3updtmd.F90 @@ -2715,8 +2715,7 @@ END SUBROUTINE W3URHO !> at (IXY,-1) indicates the transparency to be used if the lower !> or left boundary is an inflow boundary. (IXY,1) is used if the !> upper or right boundary is an inflow boundary. (IXY,0) is used - !> - for all other cases (by definition full transparency). + !> for all other cases (by definition full transparency). !> !> @param[inout] TRNX Transparencies from model definition file. !> @param[inout] TRNY Transparencies from model definition file. From 9ca8170278cb7f6e10da3977c8291c026f92b894 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:28:03 -0400 Subject: [PATCH 19/22] w3uostmd.F90: spelling fix --- model/src/w3uostmd.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/src/w3uostmd.F90 b/model/src/w3uostmd.F90 index 110e1f4138..0623043e55 100644 --- a/model/src/w3uostmd.F90 +++ b/model/src/w3uostmd.F90 @@ -1,5 +1,5 @@ !> @file -!> @brief Parmeterization of the unresoled obstacles. +!> @brief Parmeterization of the unresolved obstacles. !> !> @author Lorenzo Mentaschi !> @date 08-Oct-2018 @@ -9,7 +9,7 @@ !/ ------------------------------------------------------------------- / !> -!> @brief Parmeterization of the unresoled obstacles. +!> @brief Parmeterization of the unresolved obstacles. !> !> @author Lorenzo Mentaschi !> @date 08-Oct-2018 From ebcd8b727d352d21508e934636066f5f6bf301fb Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:34:32 -0400 Subject: [PATCH 20/22] w3uostmd.F90: attempts to get subs/funcs to render in doxygen --- model/src/w3uostmd.F90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/model/src/w3uostmd.F90 b/model/src/w3uostmd.F90 index 0623043e55..17d6aa7f6a 100644 --- a/model/src/w3uostmd.F90 +++ b/model/src/w3uostmd.F90 @@ -347,10 +347,8 @@ END SUBROUTINE UOST_SRCTRMCOMPUTE !> !> @brief Loads local and shadow alpha and beta from files. !> - !> @param[inout] GRD Object representing the spatial grid to - !> be loaded. - !> @param[inout] SRD Object representing the current spectral - !> grid. + !> @param[inout] GRD Object representing the spatial grid to be loaded. + !> @param[inout] SRD Object representing the current spectral grid. !> @param[inout] FILEUNIT Unit id of the input files. !> !> @author Lorenzo Mentaschi @@ -600,8 +598,7 @@ END SUBROUTINE LOAD_ALPHABETA_FROMFILE !> actual spatial and spectral grid. !> !> @param[inout] THIS - !> @param[in] GRD Object representing the spatial grid to - !> be loaded. + !> @param[in] GRD Object representing the spatial grid to be loaded. !> @param[in] SGD Object representing the current spectral grid. !> !> @author Lorenzo Mentaschi From f0a870ac77f879f8869fd81ce1754c4ca27af8fe Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:42:02 -0400 Subject: [PATCH 21/22] w3triamd.F90: spelling --- model/src/w3triamd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/src/w3triamd.F90 b/model/src/w3triamd.F90 index ca18a57366..6647fefae8 100644 --- a/model/src/w3triamd.F90 +++ b/model/src/w3triamd.F90 @@ -1329,7 +1329,7 @@ END SUBROUTINE COORDMAX !> median dual cell. For a given point, the surface of the dual cell is one third !> of the sum of the surface of connected triangles. !> - !> This routine is from WWM developped in Darmstadt(Aaron Roland). + !> This routine is from WWM developed in Darmstadt(Aaron Roland). !> !> @param[in] IMOD Model number to point to. !> From 3ad2b88dd12c90a1b3da35f49afc0b89968dc510 Mon Sep 17 00:00:00 2001 From: Matt Masarik Date: Thu, 27 Oct 2022 17:53:48 -0400 Subject: [PATCH 22/22] w3src3md.F90: left of @brief for w3sin3() --- model/src/w3src3md.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/model/src/w3src3md.F90 b/model/src/w3src3md.F90 index 86b9aa69d4..4f61ae682a 100644 --- a/model/src/w3src3md.F90 +++ b/model/src/w3src3md.F90 @@ -348,9 +348,13 @@ END SUBROUTINE W3SPR3 !/ ------------------------------------------------------------------- / !> - !> @brief + !> @brief Calculate diagonal and input source term for WAM4+ approach. !> - !> @details + !> @verbatim + !> WAM-4 : Janssen et al. + !> WAM-"4.5" : gustiness effect (Cavaleri et al. ) + !> SWELLF: damping coefficient (=1) for Janssen (2004) theory + !> @endverbatim !> !> @param[in] A Action density spectrum (1-D). !> @param[in] CG Group speed.