diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index e807afd38..4fd3648a3 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -1,3 +1,12 @@ +!> @file +!> @brief Contains module WMESMFMD. +!> +!> @author T. J. Campell +!> @author J. Meixner +!> @author A. J. van der Westhuysen +!> @date 09-Aug-2017 +!> + #include "w3macros.h" !/ !/ ------------------------------------------------------------------- / @@ -42,6 +51,19 @@ #define TEST_WMESMFMD_READFROMFILE___disabled !/ !/ ------------------------------------------------------------------- / +!> +!> @brief National Unified Prediction Capability (NUOPC) based +!> Earth System Modeling Framework (ESMF) interface module for +!> multi-grid wave model. +!> +!> @details All module variables and types are scoped private by default. +!> The private module variables and types are not listed in this section. +!> +!> @author T. J. Campell +!> @author J. Meixner +!> @author A. J. van der Westhuysen +!> @date 09-Aug-2017 +!> module WMESMFMD !/ !/ +-----------------------------------+ @@ -192,121 +214,130 @@ module WMESMFMD !/ Private module parameters !/ ! --- Default Mask Convention for import/export fields - INTEGER, PARAMETER :: DEFAULT_MASK_WATER = 0 - INTEGER, PARAMETER :: DEFAULT_MASK_LAND = 1 + INTEGER, PARAMETER :: DEFAULT_MASK_WATER = 0 !< DEFAULT_MASK_WATER + INTEGER, PARAMETER :: DEFAULT_MASK_LAND = 1 !< DEFAULT_MASK_LAND ! --- Miscellaneous - integer, parameter :: stdo = 6 - type(ESMF_VM) :: vm - integer :: lpet, npet - integer :: verbosity - logical :: realizeAllExport = .false. - integer :: maskValueWater = DEFAULT_MASK_WATER - integer :: maskValueLand = DEFAULT_MASK_LAND - integer :: nz ! Number of z-levels for SDC - real(4), allocatable :: zl(:) ! Array of z-levels for SDC - character(256) :: zlfile = 'none' ! File containing z-levels for SDC - character(ESMF_MAXSTR) :: msg - real(ESMF_KIND_RX) :: zeroValue - real(ESMF_KIND_RX) :: missingValue - real(ESMF_KIND_RX) :: fillValue + integer, parameter :: stdo = 6 !< stdo + type(ESMF_VM) :: vm !< vm + integer :: lpet !< lpet + integer :: npet !< npet + integer :: verbosity !< verbosity + logical :: realizeAllExport = .false. !< realizeAllExport + integer :: maskValueWater = DEFAULT_MASK_WATER !< maskValueWater + integer :: maskValueLand = DEFAULT_MASK_LAND !< maskValueLand + integer :: nz !< nz Number of z-levels for SDC + real(4), allocatable :: zl(:) !< zl Array of z-levels for SDC + character(256) :: zlfile = 'none' !< zlfile File containing z-levels for SDC + character(ESMF_MAXSTR) :: msg !< msg + real(ESMF_KIND_RX) :: zeroValue !< zeroValue + real(ESMF_KIND_RX) :: missingValue !< missingValue + real(ESMF_KIND_RX) :: fillValue !< fillValue ! ! --- Timing - integer, parameter :: numwt=10 - character(32) :: wtnam(numwt) - integer :: wtcnt(numwt) - real(8) :: wtime(numwt) + integer, parameter :: numwt=10 !< numwt + character(32) :: wtnam(numwt) !< wtnam + integer :: wtcnt(numwt) !< wtcnt + real(8) :: wtime(numwt) !< wtime ! ! --- Import fields - type(ESMF_ArraySpec) :: impArraySpec2D - type(ESMF_StaggerLoc) :: impStaggerLoc - type(ESMF_Index_Flag) :: impIndexFlag - type(ESMF_Grid) :: impGrid - integer :: impGridID - logical :: impGridIsLocal - integer, parameter :: impHaloWidth = 3 - integer :: impHaloLWidth(2) - integer :: impHaloUWidth(2) - type(ESMF_RouteHandle) :: impHaloRH - type(ESMF_Field) :: impMask - logical :: noActiveImpFields - integer :: numImpFields - character(64), allocatable :: impFieldName(:) - character(128), allocatable :: impFieldStdName(:) - logical, allocatable :: impFieldInitRqrd(:) - logical, allocatable :: impFieldActive(:) - type(ESMF_Field), allocatable :: impField(:) + type(ESMF_ArraySpec) :: impArraySpec2D !< impArraySpec2D + type(ESMF_StaggerLoc) :: impStaggerLoc !< impStaggerLoc + type(ESMF_Index_Flag) :: impIndexFlag !< impIndexFlag + type(ESMF_Grid) :: impGrid !< impGrid + integer :: impGridID !< impGridID + logical :: impGridIsLocal !< impGridIsLocal + integer, parameter :: impHaloWidth = 3 !< impHaloWidth + integer :: impHaloLWidth(2) !< impHaloLWidth + integer :: impHaloUWidth(2) !< impHaloUWidth + type(ESMF_RouteHandle) :: impHaloRH !< impHaloRH + type(ESMF_Field) :: impMask !< impMask + logical :: noActiveImpFields !< noActiveImpFields + integer :: numImpFields !< numImpFields + character(64), allocatable :: impFieldName(:) !< impFieldName + character(128), allocatable :: impFieldStdName(:) !< impFieldStdName + logical, allocatable :: impFieldInitRqrd(:) !< impFieldInitRqrd + logical, allocatable :: impFieldActive(:) !< impFieldActive + type(ESMF_Field), allocatable :: impField(:) !< impField ! ! --- Background import fields - character(10), allocatable :: mbgFieldName(:) - character(128), allocatable :: mbgFieldStdName(:) - logical, allocatable :: mbgFieldActive(:) - type(ESMF_Field), allocatable :: mbgField(:) - type(ESMF_Field), allocatable :: bmskField(:) + character(10), allocatable :: mbgFieldName(:) !< mbgFieldName + character(128), allocatable :: mbgFieldStdName(:) !< mbgFieldStdName + logical, allocatable :: mbgFieldActive(:) !< mbgFieldActive + type(ESMF_Field), allocatable :: mbgField(:) !< mbgField + type(ESMF_Field), allocatable :: bmskField(:) !< bmskField ! ! --- Unstructured import meshes - type(ESMF_Mesh) :: impMesh -! integer :: impMeshID -! logical :: impMeshIsLocal + type(ESMF_Mesh) :: impMesh !< impMesh +! integer :: impMeshID !< impMeshID +! logical :: impMeshIsLocal !< impMeshIsLocal ! ! --- Export fields - type(ESMF_ArraySpec) :: expArraySpec2D - type(ESMF_ArraySpec) :: expArraySpec3D - type(ESMF_StaggerLoc) :: expStaggerLoc - type(ESMF_Index_Flag) :: expIndexFlag - type(ESMF_Grid) :: expGrid - integer :: expGridID = 1 - logical :: expGridIsLocal - integer, parameter :: expHaloWidth = 3 - integer :: expHaloLWidth(2) - integer :: expHaloUWidth(2) - type(ESMF_RouteHandle) :: expHaloRH - type(ESMF_Field) :: expMask - logical :: noActiveExpFields - integer :: numExpFields - character(64), allocatable :: expFieldName(:) - character(128), allocatable :: expFieldStdName(:) - integer, allocatable :: expFieldDim(:) - logical, allocatable :: expFieldActive(:) - type(ESMF_Field), allocatable :: expField(:) + type(ESMF_ArraySpec) :: expArraySpec2D !< expArraySpec2D + type(ESMF_ArraySpec) :: expArraySpec3D !< expArraySpec3D + type(ESMF_StaggerLoc) :: expStaggerLoc !< expStaggerLoc + type(ESMF_Index_Flag) :: expIndexFlag !< expIndexFlag + type(ESMF_Grid) :: expGrid !< expGrid + integer :: expGridID = 1 !< expGridID + logical :: expGridIsLocal !< expGridIsLocal + integer, parameter :: expHaloWidth = 3 !< expHaloWidth + integer :: expHaloLWidth(2) !< expHaloLWidth + integer :: expHaloUWidth(2) !< expHaloUWidth + type(ESMF_RouteHandle) :: expHaloRH !< expHaloRH + type(ESMF_Field) :: expMask !< expMask + logical :: noActiveExpFields !< noActiveExpFields + integer :: numExpFields !< numExpFields + character(64), allocatable :: expFieldName(:) !< expFieldName + character(128), allocatable :: expFieldStdName(:) !< expFieldStdName + integer, allocatable :: expFieldDim(:) !< expFieldDim + logical, allocatable :: expFieldActive(:) !< expFieldActive + type(ESMF_Field), allocatable :: expField(:) !< expField ! ! --- Unstructured export meshes - type(ESMF_Mesh) :: expMesh - integer :: expMeshID - logical :: expMeshIsLocal + type(ESMF_Mesh) :: expMesh !< expMesh + integer :: expMeshID !< expMeshID + logical :: expMeshIsLocal !< expMeshIsLocal ! ! --- Native field stuff - type(ESMF_ArraySpec) :: natArraySpec1D - type(ESMF_ArraySpec) :: natArraySpec2D - type(ESMF_ArraySpec) :: natArraySpec3D - type(ESMF_StaggerLoc) :: natStaggerLoc - type(ESMF_Index_Flag) :: natIndexFlag - type(ESMF_Grid) :: natGrid - integer :: natGridID - logical :: natGridIsLocal - type(ESMF_RouteHandle):: n2eRH + type(ESMF_ArraySpec) :: natArraySpec1D !< natArraySpec1D + type(ESMF_ArraySpec) :: natArraySpec2D !< natArraySpec2D + type(ESMF_ArraySpec) :: natArraySpec3D !< natArraySpec3D + type(ESMF_StaggerLoc) :: natStaggerLoc !< natStaggerLoc + type(ESMF_Index_Flag) :: natIndexFlag !< natIndexFlag + type(ESMF_Grid) :: natGrid !< natGrid + integer :: natGridID !< natGridID + logical :: natGridIsLocal !< natGridIsLocal + type(ESMF_RouteHandle):: n2eRH !< n2eRH ! ! --- Mediator - logical :: med_present = .false. - character(256) :: flds_scalar_name = '' - integer :: flds_scalar_num = 0 + logical :: med_present = .false. !< med_present + character(256) :: flds_scalar_name = '' !< flds_scalar_name + integer :: flds_scalar_num = 0 !< flds_scalar_num ! flds_scalar_index_nx and flds_scalar_index_nx are domain ! metadata that allows CMEPS to convert a mesh back to 2d ! space for mediator restart and history outputs - integer :: flds_scalar_index_nx = 0 - integer :: flds_scalar_index_ny = 0 + integer :: flds_scalar_index_nx = 0 !< flds_scalar_index_nx + integer :: flds_scalar_index_ny = 0 !< flds_scalar_index_ny ! --- Memory Profiling - logical :: profile_memory = .false. + logical :: profile_memory = .false. !< profile_memory ! ! --- Coupling stuff for non completely overlapped domains - logical :: merge_import = .false. - logical, allocatable :: mmskCreated(:) - type(ESMF_Field), allocatable :: mmskField(:) - type(ESMF_Field), allocatable :: mdtField(:) + logical :: merge_import = .false. !< merge_import + logical, allocatable :: mmskCreated(:) !< mmskCreated + type(ESMF_Field), allocatable :: mmskField(:) !< mmskField + type(ESMF_Field), allocatable :: mdtField(:) !< mdtField !/ !/ ------------------------------------------------------------------- / contains !/ ------------------------------------------------------------------- / +!> +!> @brief Wave model ESMF set services. +!> +!> @param gcomp Gridded component. +!> @param[out] rc Return code. +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "SetServices" subroutine SetServices ( gcomp, rc ) @@ -465,6 +496,19 @@ subroutine SetServices ( gcomp, rc ) !/ end subroutine SetServices !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize wave model (phase 0). +!> +!> @details Define the NUOPC Initialize Phase Mapping. +!> +!> @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 ) @@ -609,6 +653,19 @@ subroutine InitializeP0 ( gcomp, impState, expState, extClock, rc ) !/ end subroutine InitializeP0 !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize wave model (phase 1). +!> +!> @details Advertise fields in import and export states. +!> +!> @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 ) @@ -1339,6 +1396,21 @@ subroutine InitializeP1 ( gcomp, impState, expState, extClock, rc ) !/ end subroutine InitializeP1 !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize wave model (phase 3). +!> +!> @details Realize fields in import and export states. +!> +!> @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 +!> @author A. J. van der Westhuysen +!> @date 09-Aug-2017 +!> #undef METHOD #define METHOD "InitializeP3" subroutine InitializeP3 ( gcomp, impState, expState, extClock, rc ) @@ -1682,6 +1754,14 @@ subroutine InitializeP3 ( gcomp, impState, expState, extClock, rc ) !/ end subroutine InitializeP3 !/ ------------------------------------------------------------------- / +!> +!> @brief Finalize wave model. +!> +!> @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 ) @@ -1898,6 +1978,14 @@ subroutine Finalize ( gcomp, rc ) !/ end subroutine Finalize !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize wave model export data +!> +!> @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 ) @@ -2112,6 +2200,14 @@ subroutine DataInitialize ( gcomp, rc ) !/ end subroutine DataInitialize !/ ------------------------------------------------------------------- / +!> +!> @brief Advance wave model in time. +!> +!> @param gcomp Gridded component. +!> @param[out] rc Return code. +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "ModelAdvance" subroutine ModelAdvance ( gcomp, rc ) @@ -2308,6 +2404,14 @@ subroutine ModelAdvance ( gcomp, rc ) !/ end subroutine ModelAdvance !/ ------------------------------------------------------------------- / +!> +!> @brief Get import fields and put in internal data structures. +!> +!> @param gcomp Gridded component. +!> @param[out] rc Return code. +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "GetImport" subroutine GetImport ( gcomp, rc ) @@ -2687,6 +2791,14 @@ subroutine GetImport ( gcomp, rc ) !/ end subroutine GetImport !/ ------------------------------------------------------------------- / +!> +!> @brief Set export fields from internal data structures. +!> +!> @param gcomp Gridded component +!> @param[out] rc Return code +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "SetExport" subroutine SetExport ( gcomp, rc ) @@ -2913,6 +3025,14 @@ subroutine SetExport ( gcomp, rc ) !/ end subroutine SetExport !/ ------------------------------------------------------------------- / +!> +!> @brief Create ESMF grid for import fields. +!> +!> @param gcomp Gridded component +!> @param[out] rc Return code +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "CreateImpGrid" subroutine CreateImpGrid ( gcomp, rc ) @@ -3366,6 +3486,14 @@ subroutine CreateImpGrid ( gcomp, rc ) !/ end subroutine CreateImpGrid !/ ------------------------------------------------------------------- / +!> +!> @brief Create ESMF grid for export fields +!> +!> @param gcomp Gridded component +!> @param[out] rc Return code +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "CreateExpGrid" subroutine CreateExpGrid ( gcomp, rc ) @@ -3381,7 +3509,7 @@ subroutine CreateExpGrid ( gcomp, rc ) !/ ! 1. Purpose : ! -! Create ESMF grid for export fields +! ! ! 2. Method : ! @@ -3971,6 +4099,20 @@ subroutine CreateExpGrid ( gcomp, rc ) !/ end subroutine CreateExpGrid !/ ------------------------------------------------------------------- / +!> +!> @brief Create ESMF mesh (unstructured) for import fields. +!> +!> @details Create an ESMF Mesh for import using the unstructured mesh +!> description in W3GDATMD. At present, this import mesh is not +!> domain decomposed, but instead is defined on PET 0 only. (In +!> future, when the unstructured mesh will run on domain decomposition, +!> we will use that decomposition.) +!> +!> @param gcomp Gridded component +!> @param[out] rc Return code +!> +!> @author A. J. van der Westhuysen @date 28-Feb-2018 +!> #undef METHOD #define METHOD "CreateImpMesh" subroutine CreateImpMesh ( gcomp, rc ) @@ -4365,6 +4507,27 @@ subroutine CreateImpMesh ( gcomp, rc ) !/ end subroutine CreateImpMesh !/ ------------------------------------------------------------------- / +!> +!> @brief Create ESMF mesh (unstructured) for export fields. +!> +!> @details Create an ESMF Mesh for export using the unstructured mesh +!> description in W3GDATMD. At present, this export mesh is not domain +!> decomposed, but instead is defined on PET 0 only. (In future, when the +!> unstructured mesh will run on domain decomposition, we will use that +!> decomposition.) +!> +!> Since the internal parallel data is currently stored accross grid points +!> in a "card deck" fashion, we will define an intermediate native grid, as +!> is done for regular/curvilinear grids, and perform an ESMF regrid to the +!> export mesh. This code segment is taken from T. J. Campbell, and +!> modified to 1D, because the internal data structure for unstructred +!> meshes is an array with dimensions [NX,NY=1]. +!> +!> @param gcomp Gridded component +!> @param[out] rc Return code +!> +!> @author A. J. van der Westhuysen @date 28-Feb-2018 +!> #undef METHOD #define METHOD "CreateExpMesh" subroutine CreateExpMesh ( gcomp, rc ) @@ -4874,6 +5037,16 @@ subroutine CreateExpMesh ( gcomp, rc ) !/ end subroutine CreateExpMesh !/ ------------------------------------------------------------------- / +!> +!> @brief Setup background blending mask field for an import field. +!> +!> @param bmskField Blending mask field +!> @param impField Import field +!> @param missingVal Missing value +!> @param rc Return code +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "SetupImpBmsk" subroutine SetupImpBmsk( bmskField, impField, missingVal, rc ) @@ -5092,6 +5265,16 @@ subroutine SetupImpBmsk( bmskField, impField, missingVal, rc ) !/ end subroutine SetupImpBmsk !/ ------------------------------------------------------------------- / +!> +!> @brief Blend import field with background field. +!> +!> @param[inout] impField Import field +!> @param[in] mbgField Import background field +!> @param[in] bmskField Blending mask field +!> @param[inout] rc Return code +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "BlendImpField" subroutine BlendImpField( impField, mbgField, bmskField, rc ) @@ -5194,6 +5377,18 @@ subroutine BlendImpField( impField, mbgField, bmskField, rc ) !/ end subroutine BlendImpField !/ ------------------------------------------------------------------- / +!> +!> @brief Setup merging mask field for an import field for the cases +!> that model domains does not overlap completely. +!> +!> @param mmskField Merging mask field +!> @param impField Import field +!> @param fillVal Fill value +!> @param mskCreated Mask is created or not +!> @param rc Return code +!> +!> @author U. Turuncoglu @date 18-May-2021 +!> #undef METHOD #define METHOD "SetupImpMmsk" subroutine SetupImpMmsk( mmskField, impField, fillVal, mskCreated, rc ) @@ -5323,6 +5518,15 @@ subroutine SetupImpMmsk( mmskField, impField, fillVal, mskCreated, rc ) !/ end subroutine SetupImpMmsk !/ ------------------------------------------------------------------- / +!> +!> @brief Fill ESMF field. +!> +!> @param field +!> @param fillVal +!> @param rc +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "FieldFill" subroutine FieldFill(field, fillVal, rc) @@ -5444,6 +5648,19 @@ subroutine FieldFill(field, fillVal, rc) !/ end subroutine FieldFill !/ ------------------------------------------------------------------- / +!> +!> @brief All gather of ESMF field. +!> +!> @param field ESMF field +!> @param n1 Dimension of output array +!> @param n2 Dimension of output array +!> @param fout Global output array +!> @param rc Return code +!> +!> @author T. J. Campbell +!> @author A. J. van der Westhuysen +!> @date 20-Jan-2017 +!> #undef METHOD #define METHOD "FieldGather" subroutine FieldGather(field, n1, n2, fout, rc) @@ -5598,6 +5815,16 @@ subroutine FieldGather(field, n1, n2, fout, rc) !/ end subroutine FieldGather !/ ------------------------------------------------------------------- / +!> +!> @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 +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "FieldIndex" function FieldIndex ( fnameList, fname, rc ) result (indx) @@ -5682,6 +5909,16 @@ function FieldIndex ( fnameList, fname, rc ) result (indx) !/ end function FieldIndex !/ ------------------------------------------------------------------- / +!> +!> @brief Print wallclock timers to ESMF log file. +!> +!> @param cname +!> @param wtnam +!> @param wtcnt +!> @param wtime +!> +!> @author T. J. Campbell @date 20-Jan-2017 +!> #undef METHOD #define METHOD "PrintTimers" subroutine PrintTimers ( cname, wtnam, wtcnt, wtime ) @@ -5767,6 +6004,20 @@ subroutine PrintTimers ( cname, wtnam, wtcnt, wtime ) !/ end subroutine PrintTimers !/ ------------------------------------------------------------------- / +!> +!> @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[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 ) @@ -5899,6 +6150,15 @@ subroutine CalcDecomp ( nx, ny, nproc, npmin, adjust, nxproc, nyproc, rc ) !/ end subroutine CalcDecomp !/ ------------------------------------------------------------------- / +!> +!> @brief Get value of environment variable. +!> +!> @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 ) @@ -5987,6 +6247,13 @@ subroutine GetEnvValue ( cenv, cval, rc ) !/ end subroutine GetEnvValue !/ ------------------------------------------------------------------- / +!> +!> @brief Get array of z-levels from zlfile for SDC. +!> +!> @param[inout] rc Return code +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "GetZlevels" subroutine GetZlevels ( rc ) @@ -6095,6 +6362,14 @@ subroutine GetZlevels ( rc ) !/ end subroutine GetZlevels !/ ------------------------------------------------------------------- / +!> +!> @brief Calculate Charnock for export. +!> +!> @param chkField 2D Charnock export field +!> @param rc Return code +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "CalcCharnk" subroutine CalcCharnk ( chkField, rc ) @@ -6236,6 +6511,14 @@ subroutine CalcCharnk ( chkField, rc ) !/ end subroutine CalcCharnk !/ ------------------------------------------------------------------- / +!> +!> @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" subroutine CalcRoughl ( wrlField, rc ) @@ -6381,6 +6664,17 @@ subroutine CalcRoughl ( wrlField, rc ) !/ end subroutine CalcRoughl !/ ------------------------------------------------------------------- / +!> +!> @brief Calculate wave-bottom currents for export. +!> +!> @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" subroutine CalcBotcur ( a, wbxField, wbyField, wbpField, rc ) @@ -6605,6 +6899,17 @@ subroutine CalcBotcur ( a, wbxField, wbyField, wbpField, rc ) !/ end subroutine CalcBotcur !/ ------------------------------------------------------------------- / +!> +!> @brief Calculate 2D radiation stresses for export. +!> +!> @param[inout] a Input spectra (in par list to change shape) +!> @param[inout] sxxField RS 2D eastward-component export field +!> @param[inout] sxyField RS 2D eastward-northward-component export field +!> @param[inout] syyField RS 2D northward-component field +!> @param[inout] rc Return code +!> +!> @author T. J. Campbell @date 09-Aug-2017 +!> #undef METHOD #define METHOD "CalcRadstr2D" subroutine CalcRadstr2D ( a, sxxField, sxyField, syyField, rc ) @@ -6872,6 +7177,16 @@ subroutine CalcRadstr2D ( a, sxxField, sxyField, syyField, rc ) !/ end subroutine CalcRadstr2D !/ ------------------------------------------------------------------- / +!> +!> @brief Calculate 3D Stokes drift current for export. +!> +!> @param a Input spectra (in par list to change shape) +!> @param usxField 3D SDC eastward-component export field +!> @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" subroutine CalcStokes3D ( a, usxField, usyField, rc ) @@ -7122,6 +7437,20 @@ subroutine CalcStokes3D ( a, usxField, usyField, rc ) !/ end subroutine CalcStokes3D !/ ------------------------------------------------------------------- / +!> +!> @brief Calculate partitioned Stokes drift for export. +!> +!> @param a Input spectra (in par list to change shape) +!> @param p1xField +!> @param p1yField +!> @param p2xField +!> @param p2yField +!> @param p3xField +!> @param p3yField +!> @param rc Return code +!> +!> @author J. Meixner @date 29-Oct-2019 +!> #undef METHOD #define METHOD "CalcPStokes" subroutine CalcPStokes ( a, p1xField, p1yField, p2xField, & @@ -7320,6 +7649,18 @@ subroutine CalcPStokes ( a, p1xField, p1yField, p2xField, & !/ end subroutine CalcPStokes !/ ------------------------------------------------------------------- / +!> +!> @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[inout] rc Return code +!> +!> @author U. Turuncoglu @date 18-May-2021 +!> #undef METHOD #define METHOD "ReadFromFile" subroutine ReadFromFile (idfld, fldwx, fldwy, time0, timen, rc) diff --git a/model/src/wmfinlmd.F90 b/model/src/wmfinlmd.F90 index 10dea1dc2..25031e366 100644 --- a/model/src/wmfinlmd.F90 +++ b/model/src/wmfinlmd.F90 @@ -1,5 +1,16 @@ +!> @file +!> @brief Contains module WMFINLMD. +!> +!> @author H. L. Tolman @date 04-Feb-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Finalization of the multi-grid wave model. +!> +!> @author H. L. Tolman @date 04-Feb-2014 +!> MODULE WMFINLMD !/ !/ +-----------------------------------+ @@ -55,6 +66,11 @@ MODULE WMFINLMD !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize multi-grid version of WAVEWATCH III. +!> +!> @author H. L. Tolman @date 28-Jan-2014 +!> SUBROUTINE WMFINL !/ !/ +-----------------------------------+ diff --git a/model/src/wmgridmd.F90 b/model/src/wmgridmd.F90 index de9a2fb30..c1984a354 100644 --- a/model/src/wmgridmd.F90 +++ b/model/src/wmgridmd.F90 @@ -1,5 +1,21 @@ +!> @file +!> @brief Contains module WMGRIDMD. +!> +!> @author H. L. Tolman +!> @author W. E. Rogers +!> @date 10-Dec-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Routines to determine and process grid dependencies in the +!> multi-grid wave model. +!> +!> @author H. L. Tolman +!> @author W. E. Rogers +!> @date 10-Dec-2014 +!> MODULE WMGRIDMD !/ !/ +-----------------------------------+ @@ -116,10 +132,22 @@ MODULE WMGRIDMD !/ !/ Module private variable for checking error returns !/ - INTEGER, PRIVATE :: ISTAT + INTEGER, PRIVATE :: ISTAT !< ISTAT Checking error returns. !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Determine relations to lower ranked grids for each grid. +!> +!> @details On the fly, the opposite relations are also saved. +!> Map active boundary points to lower ranked grids. +!> +!> @param[out] FLRBPI Array with flags for external file use. +!> +!> @author H. L. Tolman +!> @author W. E. Rogers +!> @date 06-Jun-2018 +!> SUBROUTINE WMGLOW ( FLRBPI ) !/ !/ +-----------------------------------+ @@ -1058,6 +1086,16 @@ SUBROUTINE WMGLOW ( FLRBPI ) END SUBROUTINE WMGLOW !/ ------------------------------------------------------------------- / +!> +!> @brief Determine relation to higher ranked grids for each grid. +!> +!> @details Base map set in WMGLOW, supplemental data computed here. +!> Map averaging information for higher ranked grid to lower ranked grid. +!> +!> @author H. L. Tolman +!> @author W. E. Rogers +!> @date 10-Dec-2014 +!> SUBROUTINE WMGHGH !/ !/ +-----------------------------------+ @@ -3659,7 +3697,15 @@ SUBROUTINE WMGHGH !/ END SUBROUTINE WMGHGH !/ ------------------------------------------------------------------- / - SUBROUTINE WMGEQL +!> +!> @brief Determine relations to same ranked grids for each grid. +!> +!> @details Cross mapping of grid points, determine boundary distance +!> data and interpolation weights. +!> +!> @author H. L. Tolman @date 10-Dec-2014 +!> + SUBROUTINE WMGEQL !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -5081,6 +5127,14 @@ SUBROUTINE WMGEQL !/ END SUBROUTINE WMGEQL !/ ------------------------------------------------------------------- / +!> +!> @brief Generate map with flags for need of spectral grid conversion +!> between models. +!> +!> @details Test of parameters as introduced before in W3IOBC. +!> +!> @author H. L. Tolman @date 10-Dec-2014 +!> SUBROUTINE WMRSPC !/ !/ +-----------------------------------+ @@ -5217,6 +5271,16 @@ SUBROUTINE WMRSPC END SUBROUTINE WMRSPC !/ !! +!> +!> @brief Determine relations to same ranked SMC grids for each grid. +!> +!> @details Set boundary points update for regular grid in same ranked group. +!> +!> Cross mapping of grid points, use nearest sea points and no +!> interpolation is required so far. +!> +!> @author J G Li @date 12-Apr-2021 +!> SUBROUTINE WMSMCEQL !! !! Adapted from multi-grid sub WMGEQL for set up equal ranked SMC diff --git a/model/src/wminiomd.F90 b/model/src/wminiomd.F90 index da27749d5..73e90b63a 100644 --- a/model/src/wminiomd.F90 +++ b/model/src/wminiomd.F90 @@ -1,5 +1,16 @@ +!> @file +!> @brief Contains module WMINIOMD. +!> +!> @author H. L. Tolman @date 28-Sep-2016 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Internal IO routines for the multi-grid model. +!> +!> @author H. L. Tolman @date 28-Sep-2016 +!> MODULE WMINIOMD !/ !/ +-----------------------------------+ @@ -77,6 +88,19 @@ MODULE WMINIOMD !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Stage internal boundary data in the data structure BPSTGE. +!> +!> @details For the shared memory version, arrays are initialized and +!> the data are copied. For the distributed memory version, the data +!> are moved using a non-blocking send. In this case, the arrays +!> are dimensioned on the receiving side. +!> +!> @param[in] IMOD Model number of grid from which data is to +!> be staged. +!> +!> @author H. L. Tolman @date 06-Jun-2018 +!> SUBROUTINE WMIOBS ( IMOD ) !/ !/ +-----------------------------------+ @@ -450,6 +474,25 @@ SUBROUTINE WMIOBS ( IMOD ) !/ END SUBROUTINE WMIOBS !/ ------------------------------------------------------------------- / +!> +!> @brief Gather internal boundary data for a given model. +!> +!> @details For the shared memory version, data are gathered from +!> the data structure BPSTGE. For the distributed memory version, +!> the gathering of the data are finished first. +!> +!> Gathering of data is triggered by the time stamp of the data +!> that is presently in the storage arrays. +!> +!> This routine preempts the data flow normally executed by +!> W3IOBC and W3UBPT, and hence bypasses both routines in W3WAVE. +!> +!> @param[in] IMOD Model number of grid from which data is to +!> be gathered. +!> @param[out] DONE Flag for completion of operation (opt). +!> +!> @author H. L. Tolman @date 29-May-2006 +!> SUBROUTINE WMIOBG ( IMOD, DONE ) !/ !/ +-----------------------------------+ @@ -1161,6 +1204,18 @@ SUBROUTINE WMIOBG ( IMOD, DONE ) !/ END SUBROUTINE WMIOBG !/ ------------------------------------------------------------------- / +!> +!> @brief Finalize staging of internal boundary data in the data +!> structure BPSTGE (MPI only). +!> +!> @details Post appropriate 'wait' functions to assure that the +!> communication has finished. +!> +!> @param[in] IMOD Model number of grid from which data has +!> been staged. +!> +!> @author H. L. Tolman @date 29-May-2006 +!> SUBROUTINE WMIOBF ( IMOD ) !/ !/ +-----------------------------------+ @@ -1322,6 +1377,17 @@ SUBROUTINE WMIOBF ( IMOD ) !/ END SUBROUTINE WMIOBF !/ ------------------------------------------------------------------- / +!> +!> @brief Stage internal high-to-low data in the data structure HGSTGE. +!> +!> @details Directly fill staging arrays in shared memory version, or post +!> the corresponding sends in distributed memory version. +!> +!> @param[in] IMOD Model number of grid from which data is to +!> be staged. +!> +!> @author H. L. Tolman @date 28-Sep-2016 +!> SUBROUTINE WMIOHS ( IMOD ) !/ !/ +-----------------------------------+ @@ -1647,6 +1713,21 @@ SUBROUTINE WMIOHS ( IMOD ) !/ END SUBROUTINE WMIOHS !/ ------------------------------------------------------------------- / +!> +!> @brief Gather internal high-to-low data for a given model. +!> +!> @details For distributed memory version first receive all staged data. +!> After staged data is present, average, convert as necessary, +!> and store in basic spectral arrays. +!> +!> Using storage array HGSTAGE and time stamps. +!> +!> @param[in] IMOD Model number of grid from which data is to +!> be gathered. +!> @param[out] DONE Flag for completion of operation (opt). +!> +!> @author H. L. Tolman @date 20-Dec-2006 +!> SUBROUTINE WMIOHG ( IMOD, DONE ) !/ !/ +-----------------------------------+ @@ -1667,7 +1748,7 @@ SUBROUTINE WMIOHG ( IMOD, DONE ) ! ! For distributed memory version first receive all staged data. ! After staged data is present, average, convert as necessary, -! and store in basic spatral arrays. +! and store in basic spectral arrays. ! ! 2. Method : ! @@ -2236,6 +2317,18 @@ SUBROUTINE WMIOHG ( IMOD, DONE ) !/ END SUBROUTINE WMIOHG !/ ------------------------------------------------------------------- / +!> +!> @brief Finalize staging of internal high-to-low data in the data +!> structure HGSTGE (MPI only). +!> +!> @details Post appropriate 'wait' functions to assure that the +!> communication has finished. +!> +!> @param[in] IMOD Model number of grid from which data has +!> been staged. +!> +!> @author H. L. Tolman @date 16-Jan-2006 +!> SUBROUTINE WMIOHF ( IMOD ) !/ !/ +-----------------------------------+ @@ -2393,6 +2486,17 @@ SUBROUTINE WMIOHF ( IMOD ) !/ END SUBROUTINE WMIOHF !/ ------------------------------------------------------------------- / +!> +!> @brief Stage internal same-rank data in the data structure EQSTGE. +!> +!> @details Directly fill staging arrays in shared memory version, or post +!> the corresponding sends in distributed memory version. +!> +!> @param[in] IMOD Model number of grid from which data is to +!> be staged. +!> +!> @author H. L. Tolman @date 28-Sep-2016 +!> SUBROUTINE WMIOES ( IMOD ) !/ !/ +-----------------------------------+ @@ -2705,6 +2809,21 @@ SUBROUTINE WMIOES ( IMOD ) !/ END SUBROUTINE WMIOES !/ ------------------------------------------------------------------- / +!> +!> @brief Gather internal same-rank data for a given model. +!> +!> @details For distributed memory version first receive all staged +!> data. After staged data is present, average, convert as necessary, +!> and store in basic spectral arrays. +!> +!> Using storage array EQSTGE and time stamps. +!> +!> @param[in] IMOD Model number of grid from which data is to +!> be gathered. +!> @param[out] DONE Flag for completion of operation (opt). +!> +!> @author H. L. Tolman @date 22-Jan-2007 +!> SUBROUTINE WMIOEG ( IMOD, DONE ) !/ !/ +-----------------------------------+ @@ -2726,7 +2845,7 @@ SUBROUTINE WMIOEG ( IMOD, DONE ) ! ! For distributed memory version first receive all staged data. ! After staged data is present, average, convert as necessary, -! and store in basic spatral arrays. +! and store in basic spectral arrays. ! ! 2. Method : ! @@ -3272,6 +3391,18 @@ SUBROUTINE WMIOEG ( IMOD, DONE ) !/ END SUBROUTINE WMIOEG !/ ------------------------------------------------------------------- / +!> +!> @brief Finalize staging of internal same-rank data in the data +!> structure EQSTGE (MPI only). +!> +!> @details Post appropriate 'wait' functions to assure that the +!> communication has finished. +!> +!> @param[in] IMOD Model number of grid from which data has +!> been staged. +!> +!> @author H. L. Tolman @date 25-May-2006 +!> SUBROUTINE WMIOEF ( IMOD ) !/ !/ +-----------------------------------+ diff --git a/model/src/wminitmd.F90 b/model/src/wminitmd.F90 index e7cb630e8..0717298b5 100644 --- a/model/src/wminitmd.F90 +++ b/model/src/wminitmd.F90 @@ -1,5 +1,20 @@ +!> @file +!> @brief Contains module WMINITMD. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Initialization of the multi-grid wave model. +!> +!> @details As a preparation for coupled modeling, all initialization, +!> including the processing of the input file has ben included in the +!> routine. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> MODULE WMINITMD !/ !/ +-----------------------------------+ @@ -86,10 +101,31 @@ MODULE WMINITMD !/ ------------------------------------------------------------------- / PUBLIC !/ - INTEGER, PRIVATE :: NTRMAX = 1000 + !< NTRMAX Maximum number + !< of subroutine trace + !< printouts (NTRACE in + !< subr. ITRACE). + INTEGER, PRIVATE :: NTRMAX = 1000 + + !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize multi-grid version of WAVEWATCH III. +!> +!> @param[in] IDSI Unit number for input file. +!> @param[in] IDSO Unit number for output file. +!> @param[in] IDSS Unit number for "screen" output. Switch off +!> by setting equal to IDSO. +!> @param[in] IDST Unit number for test output. +!> @param[in] IDSE Unit number for error output. +!> @param[in] IFNAME File name for input file. +!> @param[in] MPI_COMM MPI communicator to be used. +!> @param[in] PREAMB File name preamble (optional). +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & MPI_COMM, PREAMB ) !/ @@ -3410,6 +3446,21 @@ END SUBROUTINE WMINIT !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize multi-grid version of WAVEWATCH III. +!> +!> @param[in] IDSI Unit number for input file. +!> @param[in] IDSO Unit number for output file. +!> @param[in] IDSS Unit number for "screen" output. Switch off +!> by setting equal to IDSO. +!> @param[in] IDST Unit number for test output. +!> @param[in] IDSE Unit number for error output. +!> @param[in] IFNAME File name for input file. +!> @param[in] MPI_COMM MPI communicator to be used. +!> @param[in] PREAMB File name preamble (optional). +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & MPI_COMM, PREAMB ) !/ diff --git a/model/src/wmiopomd.F90 b/model/src/wmiopomd.F90 index a5c5f1bab..b319a22d2 100644 --- a/model/src/wmiopomd.F90 +++ b/model/src/wmiopomd.F90 @@ -1,5 +1,17 @@ +!> @file +!> @brief Contains module WMIOPOMD. +!> +!> @author H. L. Tolman @date 06-Jun-2012 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Module for generating a single point output file for a multi- +!> grid model implementation. +!> +!> @author H. L. Tolman @date 06-Jun-2012 +!> MODULE WMIOPOMD !/ !/ +-----------------------------------+ @@ -82,6 +94,18 @@ MODULE WMIOPOMD !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Initialization for unified point output. +!> +!> @details Find highest resolution grid for each point. +!> +!> @param[in] NPT Number of output points in input. +!> @param[in] XPT (longitude) coordinates of output points. +!> @param[in] YPT (latitude) coordinates of output points. +!> @param[in] PNAMES Names of output points. +!> +!> @author H. L. Tolman @date 01-Sep-2012 +!> SUBROUTINE WMIOPP ( NPT, XPT, YPT, PNAMES ) !/ !/ +-----------------------------------+ @@ -109,7 +133,7 @@ SUBROUTINE WMIOPP ( NPT, XPT, YPT, PNAMES ) ! ! 2. Method : ! -! Find highest resolution grid for each point. +! Find highest resolution grid for each point. ! ! 3. Parameters : ! @@ -601,6 +625,17 @@ SUBROUTINE WMIOPP ( NPT, XPT, YPT, PNAMES ) !/ END SUBROUTINE WMIOPP !/ ------------------------------------------------------------------- / +!> +!> @brief Gather and write unified point output. +!> +!> @details Per-grid point output is already gathered. All data are +!> gathered in the proper storage, and written using the standard +!> W3IOPO routint from grid number 0. +!> +!> @param[in] TOUT Time for output file. +!> +!> @author H. L. Tolman @date 16-Mar-2012 +!> SUBROUTINE WMIOPO ( TOUT ) !/ !/ +-----------------------------------+ diff --git a/model/src/wmmdatmd.F90 b/model/src/wmmdatmd.F90 index 03632283b..ba219cb0b 100644 --- a/model/src/wmmdatmd.F90 +++ b/model/src/wmmdatmd.F90 @@ -1,6 +1,18 @@ +!> @file +!> @brief Contains module WMMDATMD. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> + #include "w3macros.h" ! !/ ------------------------------------------------------------------- / +!> +!> @brief Define data structures to set up wave model dynamic data for +!> several models simultaneously. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> MODULE WMMDATMD !/ !/ +-----------------------------------+ @@ -289,150 +301,280 @@ MODULE WMMDATMD !/ !/ Module private variable for checking error returns !/ - INTEGER, PRIVATE :: ISTAT + INTEGER, PRIVATE :: ISTAT !< ISTAT check error returns !/ !/ Conventional declarations !/ - INTEGER :: NMDATA = -1, IMDATA = -1 - INTEGER :: MDSI = 8, MDSO = 9, MDSS = 6, MDST = 6, & - MDSE = 6, MDSUP, NMPROC = 1, & - IMPROC = 1, NMPLOG = 1, NMPSCR = 1, & - NMPTST = 1, NMPERR = 1, NMPUPT = 1, & - STIME(2), ETIME(2), NRGRD, NRINP, & - NRGRP, NMVMAX, NGRPSMC - INTEGER :: CLKDT1(8), CLKDT2(8), CLKDT3(8) + INTEGER :: NMDATA = -1 !< NMDATA + INTEGER :: IMDATA = -1 !< IMDATA + INTEGER :: MDSI = 8 !< MDSI + INTEGER :: MDSO = 9 !< MDSO + INTEGER :: MDSS = 6 !< MDSS + INTEGER :: MDST = 6 !< MDST + INTEGER :: MDSE = 6 !< MDSE + INTEGER :: MDSUP !< MDSUP + INTEGER :: NMPROC = 1 !< NMPROC + INTEGER :: IMPROC = 1 !< IMPROC + INTEGER :: NMPLOG = 1 !< NMPLOG + INTEGER :: NMPSCR = 1 !< NMPSCR + INTEGER :: NMPTST = 1 !< NMPTST + INTEGER :: NMPERR = 1 !< NMPERR + INTEGER :: NMPUPT = 1 !< NMPUPT + INTEGER :: STIME(2) !< STIME + INTEGER :: ETIME(2) !< ETIME + INTEGER :: NRGRD !< NRGRD + INTEGER :: NRINP !< NRINP + INTEGER :: NRGRP !< NRGRP + INTEGER :: NMVMAX !< NMVMAX + INTEGER :: NGRPSMC !< NGRPSMC + + INTEGER :: CLKDT1(8) !< CLKDT1 + INTEGER :: CLKDT2(8) !< CLKDT2 + INTEGER :: CLKDT3(8) !< CLKDT3 + #ifdef W3_MPRF - INTEGER :: MDSP + INTEGER :: MDSP !< MDSP #endif #ifdef W3_MPI - INTEGER :: MPI_COMM_MWAVE - INTEGER, PARAMETER :: MTAGB = 0 - INTEGER, PARAMETER :: MTAG0 = 1000 - INTEGER, PARAMETER :: MTAG1 = 100000 - INTEGER, PARAMETER :: MTAG2 = 1500000 - INTEGER, PARAMETER :: MTAG_UB = 2**21-1 !MPI_TAG_UB on Cray XC40 + INTEGER :: MPI_COMM_MWAVE !< MPI_COMM_MWAVE + INTEGER, PARAMETER :: MTAGB = 0 !< MTAGB + INTEGER, PARAMETER :: MTAG0 = 1000 !< MTAG0 + INTEGER, PARAMETER :: MTAG1 = 100000 !< MTAG1 + INTEGER, PARAMETER :: MTAG2 = 1500000 !< MTAG2 + INTEGER, PARAMETER :: MTAG_UB = 2**21-1 !< MPI_TAG_UB on Cray XC40 #endif - INTEGER, ALLOCATABLE :: MDSF(:,:), GRANK(:), GRGRP(:), & - INGRP(:,:), GRDHGH(:,:), GRDEQL(:,:),& - GRDLOW(:,:), ALLPRC(:,:), & - MODMAP(:,:), TSYNC(:,:), TMAX(:,:), & - TOUTP(:,:), TDATA(:,:), GRSTAT(:), & - NBI2G(:,:), INPMAP(:,:) + + INTEGER, ALLOCATABLE :: MDSF(:,:) !< MDSF + INTEGER, ALLOCATABLE :: GRANK(:) !< GRANK + INTEGER, ALLOCATABLE :: GRGRP(:) !< GRGRP + INTEGER, ALLOCATABLE :: INGRP(:,:) !< INGRP + INTEGER, ALLOCATABLE :: GRDHGH(:,:) !< GRDHGH + INTEGER, ALLOCATABLE :: GRDEQL(:,:) !< GRDEQL + + INTEGER, ALLOCATABLE :: GRDLOW(:,:) !< GRDLOW + INTEGER, ALLOCATABLE :: ALLPRC(:,:) !< ALLPRC + INTEGER, ALLOCATABLE :: MODMAP(:,:) !< MODMAP + INTEGER, ALLOCATABLE :: TSYNC(:,:) !< TSYNC + INTEGER, ALLOCATABLE :: TMAX(:,:) !< TMAX + INTEGER, ALLOCATABLE :: TOUTP(:,:) !< TOUTP + INTEGER, ALLOCATABLE :: TDATA(:,:) !< TDATA + INTEGER, ALLOCATABLE :: GRSTAT(:) !< GRSTAT + INTEGER, ALLOCATABLE :: NBI2G(:,:) !< NBI2G + INTEGER, ALLOCATABLE :: INPMAP(:,:) !< INPMAP + #ifdef W3_MPI - INTEGER, ALLOCATABLE :: NBISTA(:), HGHSTA(:), EQLSTA(:) + INTEGER, ALLOCATABLE :: NBISTA(:) !< NBISTA + INTEGER, ALLOCATABLE :: HGHSTA(:) !< HGHSTA + INTEGER, ALLOCATABLE :: EQLSTA(:) !< EQLSTA #endif - REAL :: CLKFIN - REAL, ALLOCATABLE :: DTRES(:) - LOGICAL :: FLGBDI=.FALSE., FLGHG1, FLGHG2 - LOGICAL, ALLOCATABLE :: RESPEC(:,:), BCDUMP(:), & - IFLSTI(:), IFLSTL(:), IFLSTR(:) - CHARACTER(LEN=3), ALLOCATABLE :: IDINP(:,:) + + REAL :: CLKFIN !< CLKFIN + REAL, ALLOCATABLE :: DTRES(:) !< DTRES + LOGICAL :: FLGBDI=.FALSE. !< FLGBDI + LOGICAL :: FLGHG1 !< FLGHG1 + LOGICAL :: FLGHG2 !< FLGHG2 + LOGICAL, ALLOCATABLE :: RESPEC(:,:) !< RESPEC + LOGICAL, ALLOCATABLE :: BCDUMP(:) !< BCDUMP + LOGICAL, ALLOCATABLE :: IFLSTI(:) !< IFLSTI + LOGICAL, ALLOCATABLE :: IFLSTL(:) !< IFLSTL + LOGICAL, ALLOCATABLE :: IFLSTR(:) !< IFLSTR + CHARACTER(LEN=3), ALLOCATABLE :: IDINP(:,:) !< IDINP !/ !/ Data structures !/ TYPE MDATA - INTEGER :: RCLD(3), NDT(3), NMV, NRUPTS + INTEGER :: RCLD(3) !< RCLD + INTEGER :: NDT(3) !< NDT + INTEGER :: NMV !< NMV + INTEGER :: NRUPTS !< NRUPTS + #ifdef W3_MPI - INTEGER :: MPI_COMM_GRD, MPI_COMM_BCT, & - CROOT, NRQBPG, NRQHGG, NRQEQG + INTEGER :: MPI_COMM_GRD !< MPI_COMM_GRD + INTEGER :: MPI_COMM_BCT !< MPI_COMM_BCT + INTEGER :: CROOT !< CROOT + INTEGER :: NRQBPG !< NRQBPG + INTEGER :: NRQHGG !< NRQHGG + INTEGER :: NRQEQG !< NRQEQG #endif - INTEGER, POINTER :: TMV(:,:,:), NBI2S(:,:), MAPMSK(:,:), & - UPTMAP(:) + INTEGER, POINTER :: TMV(:,:,:) !< TMV + INTEGER, POINTER :: NBI2S(:,:) !< NBI2S + INTEGER, POINTER :: MAPMSK(:,:) !< MAPMSK + INTEGER, POINTER :: UPTMAP(:) !< UPTMAP + #ifdef W3_MPI - INTEGER, POINTER :: IRQBPG(:), IRQHGG(:), IRQEQG(:) + INTEGER, POINTER :: IRQBPG(:) !< IRQBPG + INTEGER, POINTER :: IRQHGG(:) !< IRQHGG + INTEGER, POINTER :: IRQEQG(:) !< IRQEQG #endif - REAL, POINTER :: DATA0(:,:), DATA1(:,:), DATA2(:,:), & - AMV(:,:), DMV(:,:) - REAL, POINTER :: MAPBDI(:,:), MAPODI(:,:) + REAL, POINTER :: DATA0(:,:) !< DATA0 + REAL, POINTER :: DATA1(:,:) !< DATA1 + REAL, POINTER :: DATA2(:,:) !< DATA2 + REAL, POINTER :: AMV(:,:) !< AMV + REAL, POINTER :: DMV(:,:) !< DMV + + REAL, POINTER :: MAPBDI(:,:) !< MAPBDI + REAL, POINTER :: MAPODI(:,:) !< MAPODI #ifdef W3_PDLIB - INTEGER, POINTER :: SEA_IPGL(:), SEA_IPGL_TO_PROC(:) + INTEGER, POINTER :: SEA_IPGL(:) !< SEA_IPGL + INTEGER, POINTER :: SEA_IPGL_TO_PROC(:) !< SEA_IPGL_TO_PROC #endif - LOGICAL :: MINIT, MSKINI, FLLSTL, FLLSTR, & - FLLSTI, FLDAT0, FLDAT1, FLDAT2 + LOGICAL :: MINIT !< MINIT + LOGICAL :: MSKINI !< MSKINI + LOGICAL :: FLLSTL !< FLLSTL + LOGICAL :: FLLSTR !< FLLSTR + LOGICAL :: FLLSTI !< FLLSTI + LOGICAL :: FLDAT0 !< FLDAT0 + LOGICAL :: FLDAT1 !< FLDAT1 + LOGICAL :: FLDAT2 !< FLDAT2 + #ifdef W3_MPI - LOGICAL :: FBCAST + LOGICAL :: FBCAST !< FBCAST #endif END TYPE MDATA + ! + TYPE BPST #ifdef W3_MPI - INTEGER :: NRQBPS, STIME(2) + INTEGER :: NRQBPS !< NRQBPS + INTEGER :: STIME(2) !< STIME #endif - INTEGER :: VTIME(2) + INTEGER :: VTIME(2) !< VTIME #ifdef W3_MPI - INTEGER, POINTER :: IRQBPS(:) + INTEGER, POINTER :: IRQBPS(:) !< IRQBPS #endif - REAL, POINTER :: SBPI(:,:) + REAL, POINTER :: SBPI(:,:) !< SBPI #ifdef W3_MPI - REAL, POINTER :: TSTORE(:,:) + REAL, POINTER :: TSTORE(:,:) !< TSTORE #endif - LOGICAL :: INIT + LOGICAL :: INIT !< INIT END TYPE BPST ! TYPE HGST - INTEGER :: VTIME(2), NTOT, NREC, NRC1, & - NSND, NSN1, NSMX, XTIME(2) + INTEGER :: VTIME(2) !< VTIME + INTEGER :: NTOT !< NTOT + INTEGER :: NREC !< NREC + INTEGER :: NRC1 !< NRC1 + INTEGER :: NSND !< NSND + INTEGER :: NSN1 !< NSN1 + INTEGER :: NSMX !< NSMX + INTEGER :: XTIME(2) !< XTIME + #ifdef W3_MPI - INTEGER :: NRQHGS, NRQOUT + INTEGER :: NRQHGS !< NRQHGS + INTEGER :: NRQOUT !< NRQOUT #endif - INTEGER, POINTER :: LJSEA(:), NRAVG(:), IMPSRC(:,:), & - ITAG(:,:), ISEND(:,:) + INTEGER, POINTER :: LJSEA(:) !< LJSEA + INTEGER, POINTER :: NRAVG(:) !< NRAVG + INTEGER, POINTER :: IMPSRC(:,:) !< IMPSRC + INTEGER, POINTER :: ITAG(:,:) !< ITAG + INTEGER, POINTER :: ISEND(:,:) !< ISEND #ifdef W3_MPI - INTEGER, POINTER :: IRQHGS(:), OUTDAT(:,:) + INTEGER, POINTER :: IRQHGS(:) !< IRQHGS + INTEGER, POINTER :: OUTDAT(:,:) !< OUTDAT #endif - REAL, POINTER :: WGTH(:,:), SHGH(:,:,:) + REAL, POINTER :: WGTH(:,:) !< WGTH + REAL, POINTER :: SHGH(:,:,:) !< SHGH #ifdef W3_MPI - REAL, POINTER :: TSTORE(:,:) + REAL, POINTER :: TSTORE(:,:) !< TSTORE #endif - LOGICAL :: INIT + LOGICAL :: INIT !< INIT END TYPE HGST + ! + TYPE EQST - INTEGER :: VTIME(2), NTOT, NREC, NSND, NAVMAX + INTEGER :: VTIME(2) !< VTIME + INTEGER :: NTOT !< NTOT + INTEGER :: NREC !< NREC + INTEGER :: NSND !< NSND + INTEGER :: NAVMAX !< NAVMAX #ifdef W3_MPI - INTEGER :: NRQEQS, NRQOUT + INTEGER :: NRQEQS !< NRQEQS + INTEGER :: NRQOUT !< NRQOUT #endif - INTEGER, POINTER :: ISEA(:), JSEA(:), NAVG(:), RIP(:,:), & - RTG(:,:), SIS(:), SJS(:), SI1(:), & - SI2(:), SIP(:), STG(:) + INTEGER, POINTER :: ISEA(:) !< ISEA + INTEGER, POINTER :: JSEA(:) !< JSEA + INTEGER, POINTER :: NAVG(:) !< NAVG + INTEGER, POINTER :: RIP(:,:) !< RIP + INTEGER, POINTER :: RTG(:,:) !< RTG + INTEGER, POINTER :: SIS(:) !< SIS + INTEGER, POINTER :: SJS(:) !< SJS + INTEGER, POINTER :: SI1(:) !< SI1 + INTEGER, POINTER :: SI2(:) !< SI2 + INTEGER, POINTER :: SIP(:) !< SIP + INTEGER, POINTER :: STG(:) !< STG + #ifdef W3_MPI - INTEGER, POINTER :: IRQEQS(:), OUTDAT(:,:) + INTEGER, POINTER :: IRQEQS(:) !< IRQEQS + INTEGER, POINTER :: OUTDAT(:,:) !< OUTDAT #endif - REAL, POINTER :: SEQL(:,:,:), WGHT(:), WAVG(:,:) + REAL, POINTER :: SEQL(:,:,:) !< SEQL + REAL, POINTER :: WGHT(:) !< WGHT + REAL, POINTER :: WAVG(:,:) !< WAVG #ifdef W3_MPI - REAL, POINTER :: TSTORE(:,:) + REAL, POINTER :: TSTORE(:,:) !< TSTORE #endif - LOGICAL :: INIT + LOGICAL :: INIT !< INIT END TYPE EQST !/ !/ Data storage !/ - TYPE(MDATA), TARGET, ALLOCATABLE :: MDATAS(:) - TYPE(BPST), TARGET, ALLOCATABLE :: BPSTGE(:,:) - TYPE(HGST), TARGET, ALLOCATABLE :: HGSTGE(:,:) - TYPE(EQST), TARGET, ALLOCATABLE :: EQSTGE(:,:) + TYPE(MDATA), TARGET, ALLOCATABLE :: MDATAS(:) !< MDATAS + TYPE(BPST), TARGET, ALLOCATABLE :: BPSTGE(:,:) !< BPSTGE + TYPE(HGST), TARGET, ALLOCATABLE :: HGSTGE(:,:) !< HGSTGE + TYPE(EQST), TARGET, ALLOCATABLE :: EQSTGE(:,:) !< EQSTGE !/ !/ Data aliasses for structure MDATA(S) !/ - INTEGER, POINTER :: RCLD(:), NDT(:), NMV, TMV(:,:,:), & - NBI2S(:,:), MAPMSK(:,:), UPTMAP(:) + INTEGER, POINTER :: RCLD(:) !< RCLD + INTEGER, POINTER :: NDT(:) !< NDT + INTEGER, POINTER :: NMV !< NMV + INTEGER, POINTER :: TMV(:,:,:) !< TMV + INTEGER, POINTER :: NBI2S(:,:) !< NBI2S + INTEGER, POINTER :: MAPMSK(:,:) !< MAPMSK + INTEGER, POINTER :: UPTMAP(:) !< UPTMAP #ifdef W3_MPI - INTEGER, POINTER :: MPI_COMM_GRD, MPI_COMM_BCT, CROOT + INTEGER, POINTER :: MPI_COMM_GRD !< MPI_COMM_GRD + INTEGER, POINTER :: MPI_COMM_BCT !< MPI_COMM_BCT + INTEGER, POINTER :: CROOT !< CROOT #endif - REAL, POINTER :: DATA0(:,:), DATA1(:,:), DATA2(:,:), & - AMV(:,:), DMV(:,:) - REAL, POINTER :: MAPBDI(:,:), MAPODI(:,:) + REAL, POINTER :: DATA0(:,:) !< DATA0 + REAL, POINTER :: DATA1(:,:) !< DATA1 + REAL, POINTER :: DATA2(:,:) !< DATA2 + REAL, POINTER :: AMV(:,:) !< AMV + REAL, POINTER :: DMV(:,:) !< DMV + + REAL, POINTER :: MAPBDI(:,:) !< MAPBDI + REAL, POINTER :: MAPODI(:,:) !< MAPODI #ifdef W3_PDLIB - INTEGER, POINTER :: SEA_IPGL(:), SEA_IPGL_TO_PROC(:) + INTEGER, POINTER :: SEA_IPGL(:) !< SEA_IPGL + INTEGER, POINTER :: SEA_IPGL_TO_PROC(:) !< SEA_IPGL_TO_PROC #endif - LOGICAL, POINTER :: MINIT, FLLSTL, FLLSTR, FLLSTI, & - FLDAT0, FLDAT1, FLDAT2 + LOGICAL, POINTER :: MINIT !< MINIT + LOGICAL, POINTER :: FLLSTL !< FLLSTL + LOGICAL, POINTER :: FLLSTR !< FLLSTR + LOGICAL, POINTER :: FLLSTI !< FLLSTI + LOGICAL, POINTER :: FLDAT0 !< FLDAT0 + LOGICAL, POINTER :: FLDAT1 !< FLDAT1 + LOGICAL, POINTER :: FLDAT2 !< FLDAT2 + #ifdef W3_MPI - LOGICAL, POINTER :: FBCAST + LOGICAL, POINTER :: FBCAST !< FBCAST #endif !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Set up the number of grids to be used. +!> +!> @details Use data stored in NGRIDS in W3GDATMD. +!> +!> @param[in] NDSE Error output unit number. +!> @param[in] NDST Test output unit number. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMNDAT ( NDSE, NDST ) !/ !/ +-----------------------------------+ @@ -623,6 +765,19 @@ SUBROUTINE WMNDAT ( NDSE, NDST ) !/ END SUBROUTINE WMNDAT !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize an individual data grid at the proper dimensions. +!> +!> @details Allocate directly into the structure array. Note that +!> this cannot be done through the pointer alias! +!> +!> @param[in] IMOD Model number to point to. +!> @param[in] NDSE Error output unit number. +!> @param[in] NDST Test output unit number. +!> @param[in] J Data set [1,2,3]. +!> +!> @author H. L. Tolman @date 10-Dec-2014 +!> SUBROUTINE WMDIMD ( IMOD, NDSE, NDST, J ) !/ !/ +-----------------------------------+ @@ -814,6 +969,18 @@ SUBROUTINE WMDIMD ( IMOD, NDSE, NDST, J ) !/ END SUBROUTINE WMDIMD !/ ------------------------------------------------------------------- / +!> +!> @brief Initialize an individual data grid at the proper dimensions. +!> +!> @details Allocate directly into the structure array. Note that +!> this cannot be done through the pointer alias! +!> +!> @param[in] IMOD Model number to point to. +!> @param[in] NDSE Error output unit number. +!> @param[in] NDST Test output unit number. +!> +!> @author H. L. Tolman @date 22-Feb-2005 +!> SUBROUTINE WMDIMM ( IMOD, NDSE, NDST ) !/ !/ +-----------------------------------+ @@ -981,6 +1148,18 @@ SUBROUTINE WMDIMM ( IMOD, NDSE, NDST ) !/ END SUBROUTINE WMDIMM !/ ------------------------------------------------------------------- / +!> +!> @brief Select one of the WAVEWATCH III grids / models. +!> +!> @details Point pointers to the proper variables in the proper element of +!> the GRIDS array. +!> +!> @param[in] IMOD Model number to point to. +!> @param[in] NDSE Error output unit number. +!> @param[in] NDST Test output unit number. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMSETM ( IMOD, NDSE, NDST ) !/ !/ +-----------------------------------+ @@ -1134,6 +1313,17 @@ END SUBROUTINE WMSETM !* * !********************************************************************** !/ ------------------------------------------------------------------- / +!> +!> @brief Introduce mapping for ISPROC and JSEA when using PDLIB +!> in the Multigrid approach. +!> +!> @param[in] ISEA +!> @param[in] J +!> @param[out] JSEA +!> @param[out] ISPROC +!> +!> @author Aron Roland @date 14-Jun-2018 +!> SUBROUTINE INIT_GET_JSEA_ISPROC_GLOB(ISEA, J, JSEA, ISPROC) !/ !/ +-----------------------------------+ diff --git a/model/src/wmscrpmd.F90 b/model/src/wmscrpmd.F90 index 1fd3dceb0..a5f4cdde3 100644 --- a/model/src/wmscrpmd.F90 +++ b/model/src/wmscrpmd.F90 @@ -1,5 +1,25 @@ +!> @file +!> @brief Contains module WMSCRPMD. +!> +!> @author E. Rogers +!> @author M. Dutour +!> @author A. Roland +!> @author F. Ardhuin +!> @date 10-Dec-2014 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Routines to determine and process grid dependencies in the +!> multi-grid wave model. +!> +!> @author E. Rogers +!> @author M. Dutour +!> @author A. Roland +!> @author F. Ardhuin +!> @date 10-Dec-2014 +!> MODULE WMSCRPMD !/ !/ +-----------------------------------+ @@ -67,10 +87,28 @@ MODULE WMSCRPMD !/ !/ Module private variable for checking error returns !/ - INTEGER, PRIVATE :: ISTAT + INTEGER, PRIVATE :: ISTAT !< ISTAT Check error returns !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Compute grid information required by SCRIP. +!> +!> @param[in] ID_SRC +!> @param[in] ID_DST +!> @param[in] MAPSTA_SRC +!> @param[in] MAPST2_SRC +!> @param[in] FLAGLL +!> @param[in] GRIDSHIFT +!> @param[in] L_MASTER +!> @param[in] L_READ +!> @param[in] L_TEST +!> +!> @author E. Rogers +!> @author M. Dutour +!> @author A. Roland +!> @date 10-Dec-2014 +!> SUBROUTINE SCRIP_WRAPPER (ID_SRC, ID_DST, & MAPSTA_SRC,MAPST2_SRC,FLAGLL,GRIDSHIFT,L_MASTER, & L_READ,L_TEST) @@ -472,6 +510,40 @@ SUBROUTINE SCRIP_WRAPPER (ID_SRC, ID_DST, & END SUBROUTINE SCRIP_WRAPPER !/ ------------------------------------------------------------------- / +!> +!> @brief Compute grid arrays for scrip for a specific unstructured grid. +!> +!> @details For interior vertices, we select for every triangle the barycenter +!> of the triangle. So to every node contained in N triangles we associate +!> a domain with N corners. Every one of those corners is contained +!> in 3 different domains. +!> +!> For nodes that are on the boundary, we have to proceed differently. +!> For every such node, we have NEIGHBOR_PREV and NEIGHBOR_NEXT which +!> are the neighbor on each side of the boundary. +!> We put a corner on the middle of the edge. We also put a corner +!> on the node itself. +!> +!> Note that instead of taking barycenters, we could have taken +!> Voronoi vertices, but this carries danger since Voronoi vertices +!> can be outside of the triangle. And it leaves open how to treat +!> the boundary. +!> +!> @param[in] ID_GRD +!> @param[out] GRID_CENTER_LON +!> @param[out] GRID_CENTER_LAT +!> @param[out] GRID_CORNER_LON +!> @param[out] GRID_CORNER_LAT +!> @param[out] GRID_MASK +!> @param[out] GRID_DIMS +!> @param[out] GRID_SIZE +!> @param[out] GRID_CORNERS +!> @param[out] GRID_RANK +!> +!> @author M. Dutour +!> @author A. Roland +!> @date 10-Dec-2014 +!> SUBROUTINE GET_SCRIP_INFO_UNSTRUCTURED (ID_GRD, & & GRID_CENTER_LON, GRID_CENTER_LAT, & & GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, & @@ -873,6 +945,28 @@ SUBROUTINE GET_SCRIP_INFO_UNSTRUCTURED (ID_GRD, & END SUBROUTINE GET_SCRIP_INFO_UNSTRUCTURED !/ ------------------------------------------------------------------- / +!> +!> @brief Compute grid arrays needed for scrip for a specific +!> structured grid. +!> +!> @details This is adapted from Erick Rogers original code by +!> splitting the original scrip_wrapper function. +!> +!> @param[in] ID_GRD +!> @param[out] GRID_CENTER_LON +!> @param[out] GRID_CENTER_LAT +!> @param[out] GRID_CORNER_LON +!> @param[out] GRID_CORNER_LAT +!> @param[out] GRID_MASK +!> @param[out] GRID_DIMS +!> @param[out] GRID_SIZE +!> @param[out] GRID_CORNERS +!> @param[out] GRID_RANK +!> +!> @author M. Dutour +!> @author A. Roland +!> @date 10-Dec-2014 +!> SUBROUTINE GET_SCRIP_INFO_STRUCTURED (ID_GRD, & & GRID_CENTER_LON, GRID_CENTER_LAT, & & GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, & @@ -1044,6 +1138,26 @@ SUBROUTINE GET_SCRIP_INFO_STRUCTURED (ID_GRD, & END SUBROUTINE GET_SCRIP_INFO_STRUCTURED !/ ------------------------------------------------------------------- / +!> +!> @brief Compute grid for scrip for a specific structured grid. +!> +!> @details This is adapted from Erick Rogers code by making it cleaner. +!> +!> @param[in] ID_GRD +!> @param[out] GRID_CENTER_LON +!> @param[out] GRID_CENTER_LAT +!> @param[out] GRID_CORNER_LON +!> @param[out] GRID_CORNER_LAT +!> @param[out] GRID_MASK +!> @param[out] GRID_DIMS +!> @param[out] GRID_SIZE +!> @param[out] GRID_CORNERS +!> @param[out] GRID_RANK +!> +!> @author M. Dutour +!> @author A. Roland +!> @date 20-Feb-2012 +!> SUBROUTINE GET_SCRIP_INFO(ID_GRD, & & GRID_CENTER_LON, GRID_CENTER_LAT, & & GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, & @@ -1160,6 +1274,37 @@ SUBROUTINE GET_SCRIP_INFO(ID_GRD, & END SUBROUTINE GET_SCRIP_INFO !/ ------------------------------------------------------------------- / +!> +!> @brief Rescale according to whether the grid is spherical or not. +!> +!> @details This is adapted from Erick Rogers scrip_wrapper. +!> +!> Purpose is to rescale according to whether the grid is spherical +!> or not and to adjust by some small shift to keep SCRIP happy +!> in situations where nodes of different grids overlay. +!> +!> We apply various transformations to the longitude latitude +!> following here the transformations that were done only in +!> finite difference meshes. +!> +!> @param[inout] GRID_CENTER_LON +!> @param[inout] GRID_CENTER_LAT +!> @param[inout] GRID_CORNER_LON +!> @param[inout] GRID_CORNER_LAT +!> @param[in] GRID_MASK +!> @param[in] GRID_DIMS +!> @param[in] GRID_SIZE +!> @param[in] GRID_CORNERS +!> @param[in] GRID_RANK +!> @param CONV_DX +!> @param CONV_DY +!> @param OFFSET +!> @param GRIDSHIFT +!> +!> @author M. Dutour +!> @author A. Roland +!> @date 20-Feb-2012 +!> SUBROUTINE SCRIP_INFO_RENORMALIZATION( & & GRID_CENTER_LON, GRID_CENTER_LAT, & & GRID_CORNER_LON, GRID_CORNER_LAT, GRID_MASK, & @@ -1253,6 +1398,17 @@ SUBROUTINE SCRIP_INFO_RENORMALIZATION( & END SUBROUTINE SCRIP_INFO_RENORMALIZATION !/ ------------------------------------------------------------------- / +!> +!> @brief Desc not available. +!> +!> @param[in] I +!> @param[out] INEXT +!> @param[out] IPREV +!> +!> @author M. Dutour +!> @author A. Roland +!> @date NA +!> SUBROUTINE TRIANG_INDEXES(I, INEXT, IPREV) ! 1. Original author : ! @@ -1273,6 +1429,20 @@ SUBROUTINE TRIANG_INDEXES(I, INEXT, IPREV) END SUBROUTINE !/ ------------------------------------------------------------------- / +!> +!> @brief This function returns the list of incidences. +!> +!> @details Output: TrigIncd - number of triangles contained by vertices. +!> +!> @param[in] MNP Number of nodes +!> @param[in] MNE List of nodes +!> @param[in] TRIGP Number of triangles +!> @param[out] TRIGINCD Number of triangles contained by vertices. +!> +!> @author M. Dutour +!> @author A. Roland +!> @date 20-Feb-2012 +!> SUBROUTINE GET_UNSTRUCTURED_VERTEX_DEGREE (MNP, MNE, TRIGP, & & TRIGINCD) ! Written: @@ -1309,6 +1479,24 @@ SUBROUTINE GET_UNSTRUCTURED_VERTEX_DEGREE (MNP, MNE, TRIGP, & END SUBROUTINE GET_UNSTRUCTURED_VERTEX_DEGREE !/ ------------------------------------------------------------------- / +!> +!> @brief Returns neighbor of a boundary node. +!> +!> @details If a node belong to a boundary, the function +!> returns the neighbor of this point on one side. +!> If the point is interior then the value 0 is set. +!> +!> @param[in] MNP Number of nodes. +!> @param[in] MNE Number of triangles. +!> @param[in] TRIGP List of nodes. +!> @param[inout] IOBP +!> @param[inout] NEIGHBOR_PREV +!> @param[inout] NEIGHBOR_NEXT +!> +!> @author M. Dutour +!> @author A. Roland +!> @date 10-Dec-2014 +!> SUBROUTINE GET_BOUNDARY(MNP, MNE, TRIGP, IOBP, NEIGHBOR_PREV, & & NEIGHBOR_NEXT) !/ +-----------------------------------+ @@ -1506,6 +1694,19 @@ SUBROUTINE GET_BOUNDARY(MNP, MNE, TRIGP, IOBP, NEIGHBOR_PREV, & END SUBROUTINE !/ ------------------------------------------------------------------- / +!> +!> @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[inout] PT +!> +!> @author Steven Brus +!> @author Ali Abdolali +!> @date 21-May-2020 +!> SUBROUTINE FIX_PERIODCITY(PT) !/ diff --git a/model/src/wmunitmd.F90 b/model/src/wmunitmd.F90 index 68365256d..f51246717 100644 --- a/model/src/wmunitmd.F90 +++ b/model/src/wmunitmd.F90 @@ -1,5 +1,20 @@ +!> @file +!> @brief Contains module WMUNITMD. +!> +!> @author H. L. Tolman @date 29-May-2009 +!> + #include "w3macros.h" !/ ------------------------------------------------------------------- / + +!> +!> @brief Dynamic assignement of unit numbers for the multi-grid wave +!> model. +!> +!> @details Allowed range of unit numbers is set in parameter statements. +!> +!> @author H. L. Tolman @date 29-May-2009 +!> MODULE WMUNITMD !/ !/ +-----------------------------------+ @@ -80,19 +95,33 @@ MODULE WMUNITMD !/ !/ Define acceptable ranges of unit numbers !/ - INTEGER, PARAMETER, PRIVATE :: UNITLW = 1, UNITHG = 120 - INTEGER, PARAMETER, PRIVATE :: INPLOW = 10, INPHGH = 49 - INTEGER, PARAMETER, PRIVATE :: OUTLOW = 50, OUTHGH = 98 - INTEGER, PARAMETER, PRIVATE :: SCRLOW = 99, SCRHGH = 100 -! - LOGICAL, PRIVATE :: FLINIT = .FALSE. - LOGICAL, PRIVATE, ALLOCATABLE :: U_USED(:) - CHARACTER(LEN= 3), PRIVATE, ALLOCATABLE :: U_TYPE(:) - CHARACTER(LEN=30), PRIVATE, ALLOCATABLE :: U_NAME(:) - CHARACTER(LEN=30), PRIVATE, ALLOCATABLE :: U_DESC(:) + INTEGER, PARAMETER, PRIVATE :: UNITLW = 1 !< UNITLW + INTEGER, PARAMETER, PRIVATE :: UNITHG = 120 !< UNITHG + INTEGER, PARAMETER, PRIVATE :: INPLOW = 10 !< INPLOW + INTEGER, PARAMETER, PRIVATE :: INPHGH = 49 !< INPHGH + INTEGER, PARAMETER, PRIVATE :: OUTLOW = 50 !< OUTLOW + INTEGER, PARAMETER, PRIVATE :: OUTHGH = 98 !< OUTHGH + INTEGER, PARAMETER, PRIVATE :: SCRLOW = 99 !< SCRLOW + INTEGER, PARAMETER, PRIVATE :: SCRHGH = 100 !< SCRHGH + ! + LOGICAL, PRIVATE :: FLINIT = .FALSE. !< FLINIT + + LOGICAL, PRIVATE, ALLOCATABLE :: U_USED(:) !< U_USED + CHARACTER(LEN= 3), PRIVATE, ALLOCATABLE :: U_TYPE(:) !< U_TYPE + CHARACTER(LEN=30), PRIVATE, ALLOCATABLE :: U_NAME(:) !< U_NAME + CHARACTER(LEN=30), PRIVATE, ALLOCATABLE :: U_DESC(:) !< U_DESC !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Allocate and initialize arrays of module. +!> +!> @details Allocate and test parameter setting. +!> +!> @param[in] NDSE Unit number for error output. +!> @param[in] NDST Unit number for test output. +!> @author H. L. Tolman @date 25-Mar-2005 +!> SUBROUTINE WMUINI ( NDSE, NDST ) !/ !/ +-----------------------------------+ @@ -297,6 +326,15 @@ SUBROUTINE WMUINI ( NDSE, NDST ) !/ END SUBROUTINE WMUINI !/ ------------------------------------------------------------------- / +!> +!> @brief Display assigned unit number information from private data base. +!> +!> @param[in] NDS Unit number for output. +!> @param[in] IREQ Request identifier. +!> +!> @author H. L. Tolman @date 25-Mar-2005 +!> + SUBROUTINE WMUDMP ( NDS, IREQ ) !/ !/ +-----------------------------------+ @@ -442,6 +480,19 @@ SUBROUTINE WMUDMP ( NDS, IREQ ) !/ END SUBROUTINE WMUDMP !/ ------------------------------------------------------------------- / +!> +!> @brief Directly set information for a unit number in the data structure. +!> +!> @param[in] NDSE Unit number for error output. +!> @param[in] NDST Unit number for test output. +!> @param[in] NDS Unit number to be assigned. +!> @param[in] FLAG Flag for assigning unit. +!> @param[in] TYPE Type identifier to be used. +!> @param[in] NAME Name of file. +!> @param[in] DESC Description of file. +!> +!> @author H. L. Tolman @date 25-Mar-2005 +!> SUBROUTINE WMUSET ( NDSE, NDST, NDS, FLAG, TYPE, NAME, DESC ) !/ !/ +-----------------------------------+ @@ -598,6 +649,20 @@ SUBROUTINE WMUSET ( NDSE, NDST, NDS, FLAG, TYPE, NAME, DESC ) !/ END SUBROUTINE WMUSET !/ ------------------------------------------------------------------- / +!> +!> @brief Find a free unit number for a given file type. +!> +!> @details Search the data base. +!> +!> @param[in] NDSE Unit number for error output. +!> @param[in] NDST Unit number for test output. +!> @param[out] NDS Unit number to be assigned. +!> @param[in] TYPE Type identifier to be used. +!> @param[in] NR Number of consecutive units needed for output +!> bounday data files. +!> +!> @author H. L. Tolman @date 20-Jan-2017 +!> SUBROUTINE WMUGET ( NDSE, NDST, NDS, TYPE, NR ) !/ !/ +-----------------------------------+ @@ -759,6 +824,17 @@ SUBROUTINE WMUGET ( NDSE, NDST, NDS, TYPE, NR ) !/ END SUBROUTINE WMUGET !/ ------------------------------------------------------------------- / +!> +!> @brief Update data base information for a given unit number. +!> +!> @details FORTRAN INQUIRE statement. +!> +!> @param[in] NDSE Unit number for error output. +!> @param[in] NDST Unit number for test output. +!> @param[in] NDS Unit number to be assigned. +!> +!> @author H. L. Tolman @date 29-Mar-2005 +!> SUBROUTINE WMUINQ ( NDSE, NDST, NDS ) !/ !/ +-----------------------------------+ diff --git a/model/src/wmupdtmd.F90 b/model/src/wmupdtmd.F90 index 545c99411..9f9b1e5a8 100644 --- a/model/src/wmupdtmd.F90 +++ b/model/src/wmupdtmd.F90 @@ -1,5 +1,16 @@ +!> @file +!> @brief Contains module WMUPDTMD. +!> +!> @author H. L. Tolman @date 22-Mar-2021 + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Update model input at the driver level of the multi-grid +!> version of WAVEWATCH III. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> MODULE WMUPDTMD !/ !/ +-----------------------------------+ @@ -74,10 +85,20 @@ MODULE WMUPDTMD !/ ------------------------------------------------------------------- / PUBLIC !/ - INTEGER, PARAMETER :: SWPMAX = 5 + INTEGER, PARAMETER :: SWPMAX = 5 !< SWPMAX !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Update inputs for selected wave model grid. +!> +!> @details Reading from native grid files if update is needed based +!> on time of data. +!> +!> @param[in] IMOD Model number +!> @param[inout] TDATA Time for which all is data available. +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMUPDT ( IMOD ,TDATA ) !/ !/ +-----------------------------------+ @@ -480,6 +501,17 @@ SUBROUTINE WMUPDT ( IMOD ,TDATA ) !/ END SUBROUTINE WMUPDT !/ ------------------------------------------------------------------- / +!> +!> @brief Update selected input using native input files. +!> +!> @details Reading from native grid files. +!> +!> @param[in] IMOD Model number. +!> @param[in] IDSTR ID string corresponding to J. +!> @param[in] J Input type. +!> @param[out] IERR Error indicator. +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMUPD1 ( IMOD, IDSTR, J, IERR ) !/ !/ +-----------------------------------+ @@ -794,10 +826,10 @@ SUBROUTINE WMUPD1 ( IMOD, IDSTR, J, IERR ) CASE ( 10 ) ! notes: ! SUBROUTINE W3FLDM in w3fldsmd.ftn : -!< INTEGER, INTENT(INOUT) :: NH, THO(2,6,NHM), TF0(2), TFN(2) -!> INTEGER, INTENT(INOUT) :: NH, THO(2,-7:6,NHM), TF0(2), TFN(2) -!< REAL, INTENT(INOUT) :: HA(NHM,6), HD(NHM,6), A0, AN, D0, DN -!> REAL, INTENT(INOUT) :: HA(NHM,-7:6), HD(NHM,-7:6), A0, AN, D0, DN +! INTEGER, INTENT(INOUT) :: NH, THO(2,6,NHM), TF0(2), TFN(2) +! INTEGER, INTENT(INOUT) :: NH, THO(2,-7:6,NHM), TF0(2), TFN(2) +! REAL, INTENT(INOUT) :: HA(NHM,6), HD(NHM,6), A0, AN, D0, DN +! REAL, INTENT(INOUT) :: HA(NHM,-7:6), HD(NHM,-7:6), A0, AN, D0, DN ! Arguments # ! THO 8 ! HA 9 @@ -822,6 +854,18 @@ SUBROUTINE WMUPD1 ( IMOD, IDSTR, J, IERR ) !/ END SUBROUTINE WMUPD1 !/ ------------------------------------------------------------------- / +!> +!> @brief Update selected input using input grids. +!> +!> @details Managing data, interpolation done in other routines. +!> +!> @param[in] IMOD Model number. +!> @param[in] J Input type. +!> @param[in] JMOD Model number source grid. +!> @param[out] IERR Error indicator. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> SUBROUTINE WMUPD2 ( IMOD, J, JMOD, IERR ) !/ !/ +-----------------------------------+ @@ -1241,6 +1285,22 @@ SUBROUTINE WMUPD2 ( IMOD, J, JMOD, IERR ) !/ END SUBROUTINE WMUPD2 !/ ------------------------------------------------------------------- / +!> +!> @brief Interpolate vector field from input grid to model grid. +!> +!> @details Interpolating or averaging from input grid. +!> +!> @param[in] IMOD Output model number +!> @param[out] VX Output vector field +!> @param[out] VY Output vector field +!> @param[in] JMOD Input model number +!> @param[in] VXI Input vector field +!> @param[in] VYI Input vector field +!> @param[in] UNDEF Value for mapped out point and points not covered. +!> @param[in] CONSTP Convervation type +!> +!> @author H. L. Tolman @date 06-Dec-2010 +!> SUBROUTINE WMUPDV ( IMOD, VX, VY, JMOD, VXI, VYI, UNDEF, CONSTP ) !/ !/ +-----------------------------------+ @@ -1909,6 +1969,19 @@ SUBROUTINE WMUPDV ( IMOD, VX, VY, JMOD, VXI, VYI, UNDEF, CONSTP ) !/ END SUBROUTINE WMUPDV !/ ------------------------------------------------------------------- / +!> +!> @brief Interpolate scalar field from input grid to model grid. +!> +!> @details Interpolating or averaging from input grid. +!> +!> @param[in] IMOD Output model number +!> @param[out] FD Output scalar field +!> @param[in] JMOD Input model number +!> @param[in] FDI Input scalar field +!> @param[in] UNDEF Value for mapped out point and points not covered. +!> +!> @author H. L. Tolman @date 06-Dec-2010 +!> SUBROUTINE WMUPDS ( IMOD, FD, JMOD, FDI, UNDEF ) !/ !/ +-----------------------------------+ @@ -2527,7 +2600,27 @@ SUBROUTINE WMUPDS ( IMOD, FD, JMOD, FDI, UNDEF ) !/ END SUBROUTINE WMUPDS !======================================================================= - +!> +!> @brief Search the location of a point(XC,YC) in a regular grid. +!> +!> @details Given an array and a value to search, it returns the index of +!> the element on the rectilinear grid that is closest to, but less +!> than, the given value. "delta" is the threshold used to determine +!> if two values are equal. +!> @verbatim +!> if ( abs(x1 - x2) <= delta) then +!> assume x1 = x2 +!> endif +!> @endverbatim +!> +!> @param LENGTH Dimension of input array +!> @param ARRAY 1D array for lats or longs +!> @param VALUE Value to located in ARRAY +!> @param DELTA Threshold to determine if two values are equal +!> @returns XYCURVISEARCH +!> +!> @author H. L. Tolman @date 20-Jan-2017 +!> FUNCTION XYCURVISEARCH(LENGTH, ARRAY, VALUE, DELTA) !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -2621,7 +2714,31 @@ FUNCTION XYCURVISEARCH(LENGTH, ARRAY, VALUE, DELTA) END FUNCTION XYCURVISEARCH ! End of function -------------------------------------------------- / - +! + +!> +!> @brief Perform interpolation from regular to curvilinear grid +!> for a scalar field. +!> +!> @details This function uses bilinear interpolation to +!> estimate the value of a function f at point (x,y). f is assumed +!> to be on a regular grid, with the grid x values specified by +!> xarray with dimension x_len and the grid y values specified by +!> yarray with dimension y_len. +!> +!> @param X_LEN Dimension in X +!> @param XARRAY 1D array for Longitudes +!> @param Y_LEN Dimension in Y +!> @param YARRAY 1D array for Latitudes +!> @param FUNC 1D Field +!> @param X Long for point in the curv grid +!> @param Y Lat for point in the curv grid +!> @param DELTA Threshold to determine if two values are equal +!> +!> @returns INTERPOLATE +!> +!> @author H. L. Tolman @date 25-Jul-2019 +!> REAL FUNCTION INTERPOLATE(X_LEN,XARRAY,Y_LEN,YARRAY,FUNC, & X,Y,DELTA) !/ @@ -2740,7 +2857,30 @@ REAL FUNCTION INTERPOLATE(X_LEN,XARRAY,Y_LEN,YARRAY,FUNC, & END FUNCTION INTERPOLATE !======================================================================== - +!> +!> @brief Perform interpolation from regular to curvilinear grid for a +!> vector field. +!> +!> @details This function uses bilinear interpolation to +!> estimate the value of a function f at point (x,y). f is assumed +!> to be on a regular grid, with the grid x values specified by +!> xarray with dimension x_len and the grid y values specified by +!> yarray with dimension y_len. +!> +!> @param[in] X_LEN Dimension in X +!> @param[in] XARRAY 1D array for Longitudes +!> @param[in] Y_LEN Dimension in Y +!> @param[in] YARRAY 1D array for Latitudes +!> @param[in] FUNC1 First component of the 2D array +!> @param[in] FUNC2 Second component of the 2D array +!> @param[in] X Long for point the curv grid +!> @param[in] Y Lat for point the curv grid +!> @param[in] DELTA Threshold to determine if two values are equal +!> @param[out] VAL1 Interpolated value at a point in curv grid +!> @param[out] VAL2 Interpolated value at a point in curv grid +!> +!> @author H. L. Tolman @date 25-Jul-2019 +!> SUBROUTINE INTERPOLATE2D(X_LEN,XARRAY,Y_LEN,YARRAY,FUNC1, & FUNC2,X,Y,DELTA,VAL1,VAL2) !/ @@ -2768,7 +2908,7 @@ SUBROUTINE INTERPOLATE2D(X_LEN,XARRAY,Y_LEN,YARRAY,FUNC1, & ! ! Parameter list ! ---------------------------------------------------------------- -! X_LEN Int. Dimension in X +! X_LEN Int. Dimension in X ! XARRAY Int. 1D array for Longitudes ! Y_LEN Int. Dimension in Y ! YARRAY Int. 1D array for Latitudes @@ -2861,7 +3001,28 @@ SUBROUTINE INTERPOLATE2D(X_LEN,XARRAY,Y_LEN,YARRAY,FUNC1, & ! END SUBROUTINE INTERPOLATE2D !==================================================================== - +!> +!> @brief This function uses averaging to estimate the value +!> of a function f at point (x,y). +!> +!> @details f is assumed to be on a regular grid, with the grid x values specified +!> by xarray with dimension x_len +!> and the grid y values specified by yarray with dimension y_len, +!> the number of point to be taken into account in x and y. +!> +!> @param X_LEN +!> @param XARRAY +!> @param Y_LEN +!> @param YARRAY +!> @param FUNC +!> @param X +!> @param Y +!> @param NPX +!> @param NPY +!> @returns AVERAGING +!> +!> @author H. L. Tolman @date 25-Jul-2019 +!> REAL FUNCTION AVERAGING(X_LEN,XARRAY,Y_LEN,YARRAY,FUNC, & X,Y,NPX,NPY) !/ diff --git a/model/src/wmwavemd.F90 b/model/src/wmwavemd.F90 index 3c33878d7..8dbf71f30 100644 --- a/model/src/wmwavemd.F90 +++ b/model/src/wmwavemd.F90 @@ -1,5 +1,16 @@ +!> @file +!> @brief Contains module WMWAVEMD. +!> +!> @author H. L. Tolman @date 22-Mar-2021 + #include "w3macros.h" !/ ------------------------------------------------------------------- / +!> +!> @brief Running the multi-grid version of WAVEWATCH III up to a +!> given ending time for each grid. +!> +!> @author H. L. Tolman @date 22-Mar-2021 +!> MODULE WMWAVEMD !/ !/ +-----------------------------------+ @@ -69,6 +80,13 @@ MODULE WMWAVEMD !/ CONTAINS !/ ------------------------------------------------------------------- / +!> +!> @brief Run multi-grid version of WAVEWATCH III. +!> +!> @param[in] TEND Ending time for calculations for each grid. +!> @author H. L. Tolman @date 22-Mar-2021 +!> + SUBROUTINE WMWAVE ( TEND ) !/ !/ +-----------------------------------+ @@ -1727,6 +1745,16 @@ SUBROUTINE WMWAVE ( TEND ) !/ END SUBROUTINE WMWAVE !/ ------------------------------------------------------------------- / +!> +!> @brief Print out action table in the log file log.\ mww3. +!> +!> @param[in] MDSO +!> @param[in] NRGRD Number of grids. +!> @param[in] TSYNC Synchronization time. +!> @param[in] GRSTAT Status array per grid. +!> +!> @author H. L. Tolman @date 22-Feb-2005 +!> SUBROUTINE WMPRNT ( MDSO, NRGRD, TSYNC, GRSTAT ) !/ !/ +-----------------------------------+ @@ -1884,6 +1912,24 @@ SUBROUTINE WMPRNT ( MDSO, NRGRD, TSYNC, GRSTAT ) !/ END SUBROUTINE WMPRNT !/ ------------------------------------------------------------------- / +!> +!> @brief Non-blocking broadcast for integer arrays. +!> +!> @details Non-blocking broadcast, initially for times only, +!> but made for any integer array. Sending data from first process +!> in the model communicator to all processes that are in the overall +!> communicator but not in the model communicator. +!> +!> Standard send and receives using defined communicator. Send +!> form first processor in communicator. +!> +!> @param[inout] DATA Data to be send/received. +!> @param[in] NR Size of array. +!> @param[in] IMOD Model number. +!> @param[in] NMOD Number of models. +!> @param[in] ID ID number, used with NMOD for ITAG. +!> @author H. L. Tolman @date 02-Feb-2007 +!> SUBROUTINE WMBCST ( DATA, NR, IMOD, NMOD, ID ) !/ !/ +-----------------------------------+ @@ -1904,7 +1950,7 @@ SUBROUTINE WMBCST ( DATA, NR, IMOD, NMOD, ID ) ! ! 2. Method : ! -! Standard send and recieves using defined communicator. Send +! Standard send and receives using defined communicator. Send ! form first processor in communicator. ! ! 3. Parameters : @@ -2059,6 +2105,21 @@ SUBROUTINE WMBCST ( DATA, NR, IMOD, NMOD, ID ) !/ END SUBROUTINE WMBCST !/ ------------------------------------------------------------------- / +!> +!> @brief Non-blocking broadcast using dummy parameter to have output. +!> +!> @details Processes wait for computations on first node to be finished. +!> Needed for profiling purposes only. +!> +!> Standard send and recieves using defined communicator. Send +!> form first processor in communicator. +!> +!> @param[in] IMOD Model number. +!> @param[in] NMOD Number of models. +!> @param[in] ID ID number, used with NMOD for ITAG. +!> +!> @author H. L. Tolman @date 21-Jun-2007 +!> SUBROUTINE WMWOUT ( IMOD, NMOD, ID ) !/ !/ +-----------------------------------+