!----- LGPL -------------------------------------------------------------------- ! ! Copyright (C) Stichting Deltares, 2011-2013. ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation version 2.1. ! ! This library is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with this library; if not, see . ! ! contact: delft3d.support@deltares.nl ! Stichting Deltares ! P.O. Box 177 ! 2600 MH Delft, The Netherlands ! ! All indications and logos of, and references to, "Delft3D" and "Deltares" ! are registered trademarks of Stichting Deltares, and remain the property of ! Stichting Deltares. All rights reserved. ! $Id$ ! $HeadURL$ !> This module contains the messaging system. !! @author arjen.markus@deltares.nl !! @author adri.mourits@deltares.nl !! @author stef.hummel@deltares.nl !! @author edwin.bos@deltares.nl module m_ec_message use precision implicit none private public :: maxMessageLen public :: setECMessage public :: getECMessage public :: getECMsgLenTrim integer, parameter :: maxMessageLen = 300 character(maxMessageLen) :: ECMessage = ' ' interface setECMessage module procedure setECMessage_char module procedure setECMessage_int end interface contains ! ======================================================================= !> subroutine setECMessage_char(string, suffix) character(len=*), intent(in) :: string character(len=*), intent(in), optional :: suffix ! if (present(suffix)) then ECMessage = trim(string) // ' ' // suffix else ECMessage = string endif end subroutine setECMessage_char ! ======================================================================= !> subroutine setECMessage_int(string, val) character(len=*), intent(in) :: string integer, intent(in) :: val ! write(ECMessage, '(a,a,i0)') trim(string), ' ', val end subroutine setECMessage_int ! ======================================================================= !> function getECMessage() result(retval) character(len=len(ECMessage)) :: retval ! retval = trim(ECMessage) ECMessage = ' ' end function getECMessage ! ======================================================================= !> function getECMsgLenTrim () result(ECMsgLenTrim) integer :: ECMsgLenTrim ! ECMsgLenTrim = len_trim(ECMessage) end function getECMsgLenTrim end module m_ec_message