LCOV - code coverage report
Current view: | top level - hemco/HEMCO/src/Core - hco_logfile_mod.F90 (source / functions) |  |  | Hit | Total | Coverage
Test: | coverage.info |  | Lines: | 0 | 123 | 0.0 %
Date: | 2024-12-17 22:39:59 |  | Functions: | 0 | 3 | 0.0 %

              Line data    Source code
           1             : !------------------------------------------------------------------------------
           2             : !                   Harmonized Emissions Component (HEMCO)                    !
           3             : !------------------------------------------------------------------------------
           4             : !BOP
           5             : !
           6             : ! !MODULE: hco_logfile_mod
           7             : !
           8             : ! !DESCRIPTION: Module HCO\_LOGFILE\_MOD contains some wrapper routines to
           9             : ! write data into the HEMCO logfile.
          10             : !\\
          11             : !\\
          12             : ! !INTERFACE:
          13             : !
          14             : MODULE HCO_LOGFILE_MOD
          15             : !
          16             : ! !USES:
          17             : !
          18             :   USE HCO_ERROR_MOD
          19             :
          20             :   IMPLICIT NONE
          21             :   PRIVATE
          22             : !
          23             : ! !PUBLIC MEMBER FUNCTIONS:
          24             : !
          25             :   PUBLIC  :: HCO_Spec2Log
          26             :   PUBLIC  :: HCO_PrintList
          27             :   PUBLIC  :: HCO_PrintDataCont
          28             : !
          29             : ! !REVISION HISTORY:
          30             : !  27 May 2014 - C. Keller   - Initialization
          31             : !  See https://github.com/geoschem/hemco for complete history
          32             : !EOP
          33             : !------------------------------------------------------------------------------
          34             : !BOC
          35             : CONTAINS
          36             : !EOC
          37             : !------------------------------------------------------------------------------
          38             : !                   Harmonized Emissions Component (HEMCO)                    !
          39             : !------------------------------------------------------------------------------
          40             : !BOP
          41             : !
          42             : ! !IROUTINE: hco_spec2log
          43             : !
          44             : ! !DESCRIPTION: Subroutine HCO\_Spec2Log writes information of a species
          45             : ! to the logfile.
          46             : !\\
          47             : !\\
          48             : ! !INTERFACE:
          49             : !
          50           0 :   SUBROUTINE HCO_Spec2Log( HcoState, ID )
          51             : !
          52             : ! !USES:
          53             : !
          54             :     USE HCO_STATE_MOD, ONLY : HCO_State
          55             : !
          56             : !
          57             : ! !INPUT PARAMETER
          58             : !
          59             :     TYPE(HCO_State),  POINTER        :: HcoState   ! HEMCO state object
          60             :     INTEGER,          INTENT(IN)     :: ID         ! HEMCO species ID
          61             : !
          62             : ! !REVISION HISTORY:
          63             : !  27 May 2014 - C. Keller   - Initialization
          64             : !  See https://github.com/geoschem/hemco for complete history
          65             : !EOP
          66             : !------------------------------------------------------------------------------
          67             : !BOC
          68             : !
          69             : ! !LOCAL VARIABLES:
          70             : !
          71             :     CHARACTER(LEN=255)  :: MSG
          72             :
          73             :     !=================================================================
          74             :     ! HCO_Spec2Log begins here
          75             :     !=================================================================
          76             :
          77           0 :     MSG = 'Species ' // TRIM(HcoState%Spc(ID)%SpcName)
          78           0 :     CALL HCO_MSG(HcoState%Config%Err,MSG)
          79           0 :     IF ( HCO_IsVerb( HcoState%Config%Err ) ) THEN
          80           0 :        write(MSG,*) '--> HcoID         : ', HcoState%Spc(ID)%HcoID
          81           0 :        CALL HCO_MSG(HcoState%Config%Err,MSG)
          82           0 :        write(MSG,*) '--> ModID         : ', HcoState%Spc(ID)%ModID
          83           0 :        CALL HCO_MSG(HcoState%Config%Err,MSG)
          84           0 :        write(MSG,*) '--> MW (g/mol)    : ', HcoState%Spc(ID)%MW_g
          85           0 :        CALL HCO_MSG(HcoState%Config%Err,MSG)
          86           0 :        write(MSG,*) '--> Henry constant: ', HcoState%Spc(ID)%HenryK0
          87           0 :        CALL HCO_MSG(HcoState%Config%Err,MSG)
          88           0 :        write(MSG,*) '--> Henry temp.   : ', HcoState%Spc(ID)%HenryCR
          89           0 :        CALL HCO_MSG(HcoState%Config%Err,MSG)
          90           0 :        write(MSG,*) '--> Henry pKA     : ', HcoState%Spc(ID)%HenryPKA
          91           0 :        CALL HCO_MSG(HcoState%Config%Err,MSG)
          92             :     ENDIF
          93             :
          94           0 :   END SUBROUTINE HCO_Spec2Log
          95             : !EOC
          96             : !------------------------------------------------------------------------------
          97             : !                   Harmonized Emissions Component (HEMCO)                    !
          98             : !------------------------------------------------------------------------------
          99             : !BOP
         100             : !
         101             : ! !ROUTINE: HCO_PrintList
         102             : !
         103             : ! !DESCRIPTION: Subroutine HCO\_PrintList displays the content of List.
         104             : !\\
         105             : !\\
         106             : ! !INTERFACE:
         107             : !
         108           0 :       SUBROUTINE HCO_PrintList ( HcoState, List )
         109             : !
         110             : ! !USES:
         111             : !
         112             :       USE HCO_STATE_MOD,     ONLY : HCO_State
         113             :       USE HCO_TYPES_MOD,     ONLY : ListCont
         114             : !
         115             : ! !INPUT ARGUMENTS:
         116             : !
         117             :       TYPE(HCO_STATE),POINTER    :: HcoState
         118             :       TYPE(ListCont), POINTER    :: List
         119             : !
         120             : ! !REVISION HISTORY:
         121             : !  20 Apr 2013 - C. Keller - Initial version
         122             : !  See https://github.com/geoschem/hemco for complete history
         123             : !EOP
         124             : !------------------------------------------------------------------------------
         125             : !BOC
         126             : !
         127             : ! !ARGUMENTS:
         128             : !
         129             :       TYPE(ListCont), POINTER   :: TmpLct
         130             :       CHARACTER(LEN=255)        :: MSG
         131             :
         132             :       ! ================================================================
         133             :       ! HCO_PrintList begins here
         134             :       ! ================================================================
         135             :
         136             :       ! Point to first element
         137           0 :       TmpLct => List
         138           0 :       DO WHILE ( ASSOCIATED(TmpLct) )
         139           0 :          IF ( ASSOCIATED(TmpLct%Dct) ) THEN
         140           0 :             CALL HCO_PrintDataCont( HcoState,TmpLct%Dct )
         141             :          ENDIF
         142           0 :          TmpLct => TmpLct%NextCont
         143             :       ENDDO
         144             :
         145           0 :       TmpLct => NULL()
         146             :
         147           0 :       END SUBROUTINE HCO_PrintList
         148             : !EOC
         149             : !------------------------------------------------------------------------------
         150             : !                   Harmonized Emissions Component (HEMCO)                    !
         151             : !------------------------------------------------------------------------------
         152             : !BOP
         153             : !
         154             : ! !ROUTINE: HCO_PrintDataCont
         155             : !
         156             : ! !DESCRIPTION: Subroutine HCO\_PrintDataCont displays the content of the
         157             : ! data container Dct.
         158             : !\\
         159             : !\\
         160             : ! !INTERFACE:
         161             : !
         162           0 :       SUBROUTINE HCO_PrintDataCont ( HcoState, Dct )
         163             : !
         164             : ! !USES
         165             : !
         166             :       USE HCO_STATE_MOD,     ONLY : HCO_State
         167             :       USE HCO_TYPES_MOD,     ONLY : DataCont, HCO_DCTTYPE_BASE
         168             : !
         169             : ! !INPUT ARGUMENTS:
         170             : !
         171             :       TYPE(HCO_STATE),POINTER    :: HcoState
         172             :       TYPE(DataCont), POINTER    :: Dct
         173             : !
         174             : ! !REVISION HISTORY:
         175             : !  20 Apr 2013 - C. Keller - Initial version
         176             : !  See https://github.com/geoschem/hemco for complete history
         177             : !EOP
         178             : !------------------------------------------------------------------------------
         179             : !BOC
         180             : !
         181             : ! !ARGUMENTS:
         182             : !
         183             :       CHARACTER(LEN=255) :: MSG
         184             :       INTEGER            :: nx, ny, nz, nt
         185             :       REAL(sp)           :: sm, mn, mx
         186             :
         187             :       ! ================================================================
         188             :       ! HCO_PrintDataCont begins here
         189             :       ! ================================================================
         190             :
         191           0 :       sm = 0.0_sp
         192           0 :       mn = 0.0_sp
         193           0 :       mx = 0.0_sp
         194             :       sm = 0.0_sp
         195           0 :       nx = 0
         196           0 :       ny = 0
         197           0 :       nz = 0
         198           0 :       nt = Dct%Dta%nt
         199           0 :       IF ( nt > 0 ) THEN
         200           0 :          IF ( Dct%Dta%spaceDim<=2 ) THEN
         201           0 :             IF ( ASSOCIATED(Dct%Dta%V2) ) THEN
         202           0 :                nx = SIZE(Dct%Dta%V2(1)%Val,1)
         203           0 :                ny = SIZE(Dct%Dta%V2(1)%Val,2)
         204           0 :                sm = SUM(Dct%Dta%V2(1)%Val)
         205           0 :                mn = MINVAL(Dct%Dta%V2(1)%Val)
         206           0 :                mx = MAXVAL(Dct%Dta%V2(1)%Val)
         207             :             ENDIF
         208             :          ELSE
         209           0 :             IF ( ASSOCIATED(Dct%Dta%V3) ) THEN
         210           0 :                nx = SIZE(Dct%Dta%V3(1)%Val,1)
         211           0 :                ny = SIZE(Dct%Dta%V3(1)%Val,2)
         212           0 :                nz = SIZE(Dct%Dta%V3(1)%Val,3)
         213           0 :                sm = SUM(Dct%Dta%V3(1)%Val)
         214           0 :                mn = MINVAL(Dct%Dta%V3(1)%Val)
         215           0 :                mx = MAXVAL(Dct%Dta%V3(1)%Val)
         216             :             ENDIF
         217             :          ENDIF
         218             :       ENDIF
         219             :
         220             :       ! Print name for verbose > 0
         221           0 :       IF ( HCO_IsVerb( HcoState%Config%Err ) ) THEN
         222           0 :          MSG = 'Container ' // TRIM(Dct%cName)
         223           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         224             :       ENDIF
         225             :
         226             :       ! Eventually add details
         227           0 :       IF ( HCO_IsVerb( HcoState%Config%Err ) ) THEN
         228             :
         229             :          ! General information
         230           0 :          write(MSG,*) '   -->Data type       : ', Dct%DctType
         231           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         232           0 :          write(MSG,*) '   -->Container ID    : ', Dct%cID
         233           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         234           0 :          write(MSG,*) '   -->Target ID       : ', Dct%targetID
         235           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         236           0 :          write(MSG,*) '   -->File data home?   ', Dct%DtaHome
         237           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         238           0 :          write(MSG,*) '   -->Source file     : ', TRIM(Dct%Dta%ncFile)
         239           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         240           0 :          write(MSG,*) '   -->ncRead?           ', Dct%Dta%ncRead
         241           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         242           0 :          write(MSG,*) '   -->Shared data file? ', Dct%Dta%DoShare
         243           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         244           0 :          IF ( Dct%Dta%ncRead ) THEN
         245           0 :             write(MSG,*) '   -->Source parameter: ', TRIM(Dct%Dta%ncPara)
         246           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         247           0 :             write(MSG,*) '   -->Year range      : ', Dct%Dta%ncYrs
         248           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         249           0 :             write(MSG,*) '   -->Month range     : ', Dct%Dta%ncMts
         250           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         251           0 :             write(MSG,*) '   -->Day range       : ', Dct%Dta%ncDys
         252           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         253           0 :             write(MSG,*) '   -->Hour range      : ', Dct%Dta%ncHrs
         254           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         255           0 :             write(MSG,*) '   -->SpaceDim        : ', Dct%Dta%SpaceDim
         256           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         257             :          ENDIF
         258           0 :          IF ( NZ > 0 ) THEN
         259           0 :             write(MSG,*) '   -->Array dimension : ', nx,ny,nz
         260             :          ELSE
         261           0 :             write(MSG,*) '   -->Array dimension : ', nx,ny
         262             :          ENDIF
         263           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         264           0 :          write(MSG,*) '   -->Array sum       : ', sm
         265           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         266           0 :          write(MSG,*) '   -->Array min & max : ', mn,mx
         267           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         268           0 :          write(MSG,*) '   -->Time dimension  : ', nt
         269           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         270           0 :          write(MSG,*) '   -->Delta t[h]      : ', Dct%Dta%DeltaT
         271           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         272           0 :          write(MSG,*) '   -->Local time?       ', Dct%Dta%IsLocTime
         273           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         274           0 :          IF ( ASSOCIATED(Dct%Dta%tIDx) ) THEN
         275           0 :             write(MSG,*) '   -->Tempres         : ', &
         276           0 :                TRIM(Dct%Dta%tIDx%TempRes)
         277           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         278             :          ENDIF
         279           0 :          write(MSG,*) '   -->OrigUnit        : ',TRIM(Dct%Dta%OrigUnit)
         280           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         281           0 :          write(MSG,*) '   -->Concentration?    ', Dct%Dta%IsConc
         282           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         283           0 :          write(MSG,*) '   -->Coverage        : ', Dct%Dta%Cover
         284           0 :          CALL HCO_MSG(HcoState%Config%Err,MSG)
         285             :
         286             :          ! For base emissions
         287           0 :          IF ( Dct%DctType==HCO_DCTTYPE_BASE ) THEN
         288           0 :             write(MSG,*) '   -->Extension Nr    : ', Dct%ExtNr
         289           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         290           0 :             write(MSG,*) '   -->Species name    : ',TRIM(Dct%SpcName)
         291           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         292           0 :             write(MSG,*) '   -->HEMCO species ID: ', Dct%HcoID
         293           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         294           0 :             write(MSG,*) '   -->Category        : ', Dct%Cat
         295           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         296           0 :             write(MSG,*) '   -->Hierarchy       : ', Dct%Hier
         297           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         298           0 :             IF ( nz == 0 ) THEN
         299           0 :                write(MSG,*) '   -->2D emitted into : ', Dct%Dta%EmisL1, &
         300           0 :                             ' and ', Dct%Dta%EmisL2
         301           0 :                CALL HCO_MSG(HcoState%Config%Err,MSG)
         302             :             ENDIF
         303             :
         304             :          ! For scale factors
         305             :          ELSE
         306           0 :             write(MSG,*) '   -->Scal ID         : ', Dct%ScalID
         307           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         308           0 :             write(MSG,*) '   -->Operator        : ', Dct%Oper
         309           0 :             CALL HCO_MSG(HcoState%Config%Err,MSG)
         310             :          ENDIF
         311             :       ENDIF
         312             :
         313           0 :       END SUBROUTINE HCO_PrintDataCont
         314             : !EOC
         315             : END MODULE HCO_LOGFILE_MOD

Generated by: LCOV version 1.14