Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 4896)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 4897)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Few informative messages removed, small changes in comments and chemistry header
+!
+!
+! 4895 2021-03-03 15:39:08Z suehring
 ! Remove offset in terrain-following masked output
 !
@@ -309,12 +313,5 @@
 !> @todo Adjust chem_rrd_local to CASE structure of others modules. It is not allowed to use the
 !>       chemistry model in a precursor run and additionally not using it in a main run
-!> @todo Implement turbulent inflow of chem spcs in inflow_turbulence.
-!> @todo Separate boundary conditions for each chem spcs to be implemented
-!> @todo Currently only total concentration are calculated. Resolved, parameterized and chemistry
-!>       fluxes although partially and some completely coded but are not operational/activated in
-!>       this version. bK.
-!> @todo slight differences in passive scalar and chem spcs when chem reactions turned off. Need to
-!>       be fixed. bK
-!> @todo chemistry error messages
+!> @todo Implement turbulent inflow of chem spcs in inflow_turbulence. Do we need this? Not done for salsa either. 
 !
 !--------------------------------------------------------------------------------------------------!
@@ -369,4 +366,5 @@
                 message_string,                                                                    &
                 monotonic_limiter_z,                                                               &
+                nesting_offline,                                                                   &
                 omega,                                                                             &
                 restart_data_format_output,                                                        &
@@ -799,6 +797,10 @@
 !--    Boundary condtions for chemical species at horizontal walls
        DO  lsp = 1, nspec
-
-          IF ( ibc_cs_b == 0 )  THEN
+!
+!--       Surface conditions:
+          IF ( ibc_cs_b == 0 )  THEN    ! Dirichlet
+!
+!--          Run loop over all non-natural and natural walls. Note, in wall-datatype the k
+!--          coordinate belongs to the atmospheric grid point, therefore, set s_p at k-1
              DO  l = 0, 1
                 !$OMP PARALLEL DO PRIVATE( i, j, k )
@@ -812,8 +814,6 @@
              ENDDO
 
-          ELSEIF ( ibc_cs_b == 1 )  THEN
-!
-!--          In boundary_conds there is som extra loop over m here for passive tracer
-!>           TODO: clarify the meaning of the above comment. Explain in more detail or remove it. (Siggi)
+          ELSEIF ( ibc_cs_b == 1 )  THEN     ! Neumann
+!
              DO  l = 0, 1
                 !$OMP PARALLEL DO PRIVATE( i, j, k )
@@ -830,7 +830,5 @@
 
 !
-!--    Top boundary conditions for chemical species - Should this not be done for all species?
-!>     TODO: This question also needs to be clarified. I guess it can be removed because the loop
-!>           already runs over all species? (Siggi)
+!--    Top boundary conditions for chemical species 
        DO  lsp = 1, nspec
           IF ( ibc_cs_t == 0 )  THEN
@@ -1241,20 +1239,9 @@
 
 !
-!-- Check for chemical reactions status
-    IF ( chem_gasphase_on )  THEN
-       message_string = 'Chemical reactions: ON'
-       CALL message( 'chem_check_parameters', 'PA0517', 0, 0, 0, 6, 0 )
-    ELSEIF ( .NOT. ( chem_gasphase_on ) )  THEN
-       message_string = 'Chemical reactions: OFF'
-       CALL message( 'chem_check_parameters', 'PA0517', 0, 0, 0, 6, 0 )
-    ENDIF
-!
 !-- Check for chemistry time-step
     IF ( call_chem_at_all_substeps )  THEN
-       message_string = 'Chemistry is calculated at all meteorology time-step'
+       message_string =                                                                            &
+       'Warning: call_chem_at_all_substeps shoukld only be used for test purposes! '
        CALL message( 'chem_check_parameters', 'PA0522', 0, 0, 0, 6, 0 )
-    ELSEIF ( .NOT. ( call_chem_at_all_substeps ) )  THEN
-       message_string = 'Sub-time-steps are skipped for chemistry time-steps'
-       CALL message( 'chem_check_parameters', 'PA0518', 0, 0, 0, 6, 0 )
     ENDIF
 !
@@ -1405,5 +1392,4 @@
 !-- chem_check_parameters is called before the array chem_species is allocated!
 !-- temporary switch of this part of the check
-!    RETURN                !bK commented
 !> TODO: this workaround definitely needs to be removed from here!!!
     CALL chem_init_internal
@@ -1868,8 +1854,6 @@
     ENDIF
 !
-!-- Chemistry time-step
-    WRITE ( io, 4 ) cs_time_step
-!
 !-- Emission mode info
+    WRITE ( io, 4 ) emiss_read_legacy_mode
 !-- At the moment the evaluation is done with both emiss_lod and mode_emis but once salsa has been
 !-- migrated to emiss_lod the .OR. mode_emis conditions can be removed (ecc 20190513)
@@ -1922,5 +1906,5 @@
 
     IF ( nesting_chem )  WRITE( io, 12 )  nesting_chem
-    IF ( nesting_offline_chem )  WRITE( io, 13 )  nesting_offline_chem
+    IF ( nesting_offline_chem .AND. nesting_offline )  WRITE( io, 13 )  nesting_offline_chem
 
     WRITE( io, 14 )  TRIM( bc_cs_b ), TRIM( bc_cs_t ), TRIM( bc_cs_s ), TRIM( bc_cs_n ),           &
@@ -1930,8 +1914,10 @@
 !-- Number of variable and fix chemical species and number of reactions
     cs_fixed = nspec - nvar
-    WRITE ( io, * ) '   --> Chemical Mechanism        : ', cs_mech
-    WRITE ( io, * ) '   --> Chemical species, variable: ', nvar
-    WRITE ( io, * ) '   --> Chemical species, fixed   : ', cs_fixed
-    WRITE ( io, * ) '   --> Total number of reactions : ', nreact
+    WRITE ( io, * ) '   --> Chemical Mechanism          : ', cs_mech
+    WRITE ( io, * ) '   --> Chemical species, variable  : ', nvar
+    WRITE ( io, * ) '   --> Chemical species, fixed     : ', cs_fixed
+    WRITE ( io, * ) '   --> Total number of reactions   : ', nreact
+    WRITE ( io, * ) '   --> Gas phase chemistry solver  : ', icntrl(3)
+    WRITE ( io, * ) '   --> Vector length (vector mode if > 1): ', vl_dim
 
 
@@ -1939,18 +1925,19 @@
 2   FORMAT ('    --> Chemical reactions are turned on')
 3   FORMAT ('    --> Chemical reactions are turned off')
-4   FORMAT ('    --> Time-step for chemical species: ',F6.2, ' s')
+4   FORMAT ('    --> Legacy emission read mode: ',L3,/,                                            &
+            '        All emissions data will be loaded prior to start of simulation')
 5   FORMAT ('    --> Emission mode = DEFAULT ')
-6   FORMAT ('    --> Emission mode = PARAMETERIZED ')
-7   FORMAT ('    --> Emission mode = PRE-PROCESSED ')
+6   FORMAT ('    --> Emission mode = PARAMETERIZED (LOD 0)')
+7   FORMAT ('    --> Emission mode = PRE-PROCESSED (LOD 2)')
 8   FORMAT ('    --> Photolysis scheme used =  simple ')
 9   FORMAT ('    --> Photolysis scheme used =  constant ')
 10  FORMAT (/'    ',A)
 11  FORMAT (/'    ',A)
-12  FORMAT (/'   Nesting for chemistry variables: ', L1 )
-13  FORMAT (/'   Offline nesting for chemistry variables: ', L1 )
-14  FORMAT (/'   Boundary conditions for chemical species:', /                                     &
-             '      bottom/top:   ',A10,' / ',A10, /                                               &
-             '      north/south:  ',A10,' / ',A10, /                                               &
-             '      left/right:   ',A10,' / ',A10)
+12  FORMAT (/'    Self nesting for chemistry variables (if nested_run): ', L1 )
+13  FORMAT (/'    Offline nesting for chemistry variables : ', L1 )
+14  FORMAT (/'    Boundary conditions for chemical species:', /                                     &
+             '       bottom/top:   ',A10,' / ',A10, /                                               &
+             '       north/south:  ',A10,' / ',A10, /                                               &
+             '       left/right:   ',A10,' / ',A10)
 
  END SUBROUTINE chem_header
@@ -2126,17 +2113,16 @@
 
 !
-!-- For some passive scalars decycling may be enabled. This case, the lateral boundary conditions
-!-- are non-cyclic for these scalars (chemical species and aerosols), while the other scalars may
-!-- have cyclic boundary conditions. However, large gradients near the boundaries may produce
-!-- stationary numerical oscillations near the lateral boundaries when a higher-order scheme is
+!-- For chemistry variables lateral boundary conditions can be set non-cyclic while 
+!-- the other scalars may have cyclic boundary conditions.
+!-- However, large gradients near the boundaries may produce stationary numerical 
+!-- oscillations near the lateral boundaries when a higher-order scheme is
 !-- applied near these boundaries.
 !-- To get rid-off this, set-up additional flags that control the order of the scalar advection
-!-- scheme near the lateral boundaries for passive scalars with decycling.
+!-- scheme near the lateral boundaries for passive scalars with  non-cyclic bcs
     IF ( scalar_advec == 'ws-scheme' )  THEN
        ALLOCATE( cs_advc_flags_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
 !
-!--    In case of decyling, set Neumann boundary conditions for wall_flags_total_0 bit 31 instead of
-!--    cyclic boundary conditions.
-!--    Bit 31 is used to identify extended degradation zones (please see following comment).
+!--    In case of non-cyclic boundary conditions set wall_flags_total_0 bit 31 
+!--    Bit 31 is used to identify extended degradation zones.
 !--    Note, since several also other modules like Salsa or other future one may access this bit but
 !--    may have other boundary conditions, the original value of wall_flags_total_0 bit 31 must not
@@ -2613,11 +2599,4 @@
 
 !
-! For reference (ecc)
-!    IF ( (mode_emis /= 'PARAMETERIZED')  .AND. ( mode_emis /= 'DEFAULT' ) .AND. ( mode_emis /= 'PRE-PROCESSED'  ) )  THEN
-!       message_string = 'Incorrect mode_emiss  option select. Please check spelling'
-!       CALL message( 'chem_parin', 'PA0731', 1, 2, 0, 6, 0 )
-!    ENDIF
-
-!
 !-- Conflict resolution for emiss_lod and mode_emis
 !-- 1) if emiss_lod is defined, have mode_emis assume same setting as emiss_lod
@@ -2629,4 +2608,6 @@
 
           SELECT CASE  ( emiss_lod )
+!
+!-- Synchronize mode_emis to defined emiss_lod (mode_emis will be depreciated in future releases)
              CASE (0)  !- parameterized mode
                 mode_emis = 'PARAMETERIZED'
@@ -2636,9 +2617,4 @@
                 mode_emis = 'PRE-PROCESSED'
           END SELECT
-
-          message_string = 'Synchronizing mode_emis to defined emiss_lod&'              //         &
-                           'NOTE - mode_emis will be depreciated in future releases&'   //         &
-                           'please use emiss_lod to define emission mode'
-          CALL message( 'chem_parin', 'PA0733', 0, 0, 0, 6, 0 )
 
        ELSE ! if emiss_lod is not set
@@ -2742,26 +2718,4 @@
     END IF
 
-!
-!--   todo: remove or replace by "CALL message" mechanism (kanani)
-!       write(text,*) 'gas_phase chemistry: solver_type = ',TRIM( solver_type )
-!kk    Has to be changed to right calling sequence
-!        IF(myid == 0)  THEN
-!           write(9,*) ' '
-!           write(9,*) 'kpp setup '
-!           write(9,*) ' '
-!           write(9,*) '    gas_phase chemistry: solver_type = ',TRIM( solver_type )
-!           write(9,*) ' '
-!           write(9,*) '    Hstart  = ',rcntrl(3)
-!           write(9,*) '    FacMin  = ',rcntrl(4)
-!           write(9,*) '    FacMax  = ',rcntrl(5)
-!           write(9,*) ' '
-!           IF(vl_dim > 1)  THEN
-!              write(9,*) '    Vector mode                   vektor length = ',vl_dim
-!           ELSE
-!              write(9,*) '    Scalar mode'
-!           ENDIF
-!           write(9,*) ' '
-!        END IF
-
     RETURN
 
@@ -2893,19 +2847,14 @@
 !
 !-- Calculation of chemical reactions and deposition.
-!-- !> TODO
-!-- WARNING: time measurements within i,j loops degrade performance because cpu-log routine is
-!--          called extremely often. Furthermore, because of that, the counter for this measurement
-!--          will get an extremely huge value, too.
-!--          Should be removed, because in other _ij routines no measurements are done because of
-!--          the reasons given above.
+!-- It would have been nice to have time measurements for chemistry and deposition here. 
+!-- Unfortunately measurements within i,j loops degrade performance ince they are calles so often 
+!-- and the counter for this measurement gets extremely huge values. Therefore, no measurements here.
     IF ( intermediate_timestep_count == 1  .OR.  call_chem_at_all_substeps )  THEN
 
        IF ( chem_gasphase_on )  THEN
           !$OMP MASTER
-          CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )
           !$OMP END MASTER
           CALL chem_integrate( i, j )
           !$OMP MASTER
-          CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
           !$OMP END MASTER
        ENDIF
@@ -2913,9 +2862,7 @@
        IF ( deposition_dry )  THEN
           !$OMP MASTER
-          CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
           !$OMP END MASTER
           CALL chem_depo( i, j )
           !$OMP MASTER
-          CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
           !$OMP END MASTER
        ENDIF
