New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 7351 for branches/2016/dev_INGV_UKMO_2016/NEMOGCM/TOOLS/SIREN/src/logger.f90 – NEMO

Ignore:
Timestamp:
2016-11-28T17:04:10+01:00 (7 years ago)
Author:
emanuelaclementi
Message:

ticket #1805 step 3: /2016/dev_INGV_UKMO_2016 aligned to the trunk at revision 7161

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_INGV_UKMO_2016/NEMOGCM/TOOLS/SIREN/src/logger.f90

    r5617 r7351  
    66! 
    77! DESCRIPTION: 
    8 !> @brief This module create logger file and allow to fill it depending of verbosity. 
     8!> @brief This module manage log file. 
    99!> @details 
     10!> This module create log file and fill it depending of verbosity. 
     11!> 
    1012!> verbosity could be choosen between : 
    1113!>    - trace : Most detailed information. 
     
    1719!>    - error : Other runtime errors or unexpected conditions. 
    1820!>    - fatal : Severe errors that cause premature termination. 
    19 !>  default verbosity is warning 
    2021!>    - none  : to not create and write any information in logger file.<br /> 
    21 ! 
     22!>       @warn in this case only FATAL ERROR will be detected.<br /> 
     23!> 
     24!> @note default verbosity is warning 
     25!> 
    2226!> If total number of error exceeded maximum number  
    2327!> authorized, program stop. 
     
    3539!> @code 
    3640!> CALL logger_close() 
     41!> @endcode 
     42!> 
     43!> to clean logger file:<br/> 
     44!> @code 
     45!> CALL logger_clean() 
    3746!> @endcode 
    3847!> 
     
    104113!>   CALL logger_footer() 
    105114!>   CALL logger_close() 
     115!>   CALL logger_clean() 
    106116!> @endcode 
    107117!> 
     
    116126!>   CALL logger_footer() 
    117127!>   CALL logger_close() 
     128!>   CALL logger_clean() 
    118129!> @endcode 
    119130! 
     
    125136!> - check verbosity validity 
    126137!> - add 'none' verbosity level to not used logger file 
     138!> @date January, 2016 
     139!> - add logger_clean subroutine 
    127140!> 
    128141!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    144157   PUBLIC :: logger_open        !< create a log file with given verbosity 
    145158   PUBLIC :: logger_close       !< close log file 
     159   PUBLIC :: logger_clean       !< clean log structure 
    146160   PUBLIC :: logger_header      !< write header on log file 
    147161   PUBLIC :: logger_footer      !< write footer on log file 
     
    273287      IMPLICIT NONE 
    274288      ! local variable 
    275       INTEGER(i4) :: il_status 
    276       !---------------------------------------------------------------- 
    277       IF( tm_logger%l_use )THEN 
    278          IF( tm_logger%i_id /= 0 )THEN 
    279             tm_logger%i_id = 0 
     289      INTEGER(i4)   :: il_status 
     290      !---------------------------------------------------------------- 
     291      IF( tm_logger%l_use )THEN 
     292         IF( tm_logger%i_id /= 0 )THEN 
     293            !tm_logger%i_id = 0 
    280294            CLOSE( tm_logger%i_id, & 
    281295            &      IOSTAT=il_status)       
     
    289303 
    290304   END SUBROUTINE logger_close 
     305   !------------------------------------------------------------------- 
     306   !> @brief This subroutine clean a log structure. 
     307   !> 
     308   !> @author J.Paul 
     309   !> @date January, 2016 - Initial Version 
     310   !------------------------------------------------------------------- 
     311   SUBROUTINE logger_clean() 
     312      IMPLICIT NONE 
     313      ! local variable 
     314      TYPE(TLOGGER) :: tl_logger 
     315      !---------------------------------------------------------------- 
     316      tm_logger = tl_logger 
     317 
     318   END SUBROUTINE logger_clean 
    291319   !------------------------------------------------------------------- 
    292320   !> @brief This subroutine flushing output into log file. 
     
    537565      IF( tm_logger%l_use )THEN 
    538566         IF( tm_logger%i_id /= 0 )THEN 
    539             IF( TRIM(tm_logger%c_verb) /= 'none' )THEN 
    540                ! increment the error number 
    541                tm_logger%i_nerror=tm_logger%i_nerror+1 
    542             ENDIF 
     567            ! increment the error number 
     568            tm_logger%i_nerror=tm_logger%i_nerror+1 
    543569 
    544570            IF( INDEX(TRIM(tm_logger%c_verb),'error')/=0 )THEN 
     
    571597   !> @author J.Paul 
    572598   !> @date November, 2013 - Initial Version 
     599   !> @date September, 2015 
     600   !> - stop program for FATAL ERROR if verbosity is none 
    573601   ! 
    574602   !> @param[in] cd_msg message to write 
     
    598626             CALL logger_fatal('you must have create logger to use logger_fatal') 
    599627         ENDIF 
     628      ELSE 
     629         PRINT *,"FATAL ERROR :"//TRIM(cd_msg) 
     630         STOP 
    600631      ENDIF 
    601632   END SUBROUTINE logger_fatal 
Note: See TracChangeset for help on using the changeset viewer.