Index: /palm/trunk/SOURCE/chem_emissions_mod.f90
===================================================================
--- /palm/trunk/SOURCE/chem_emissions_mod.f90	(revision 3372)
+++ /palm/trunk/SOURCE/chem_emissions_mod.f90	(revision 3373)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! Fix wrong location of __netcdf directive
+! 
+! 3337 2018-10-12 15:17:09Z kanani
 ! (from branch resler)
 ! Formatting
@@ -65,11 +68,9 @@
     USE kinds
 
-#if defined ( __netcdf )
-
     USE netcdf_data_input_mod,                                                  &
        ONLY: chem_emis_att_type, chem_emis_val_type
 
+#if defined ( __netcdf )
     USE NETCDF
-
 #endif
 
@@ -779,5 +780,5 @@
  SUBROUTINE chem_emissions_init(emt_att,emt,nspec_out)
 
-#if defined( __netcdf )
+
 
     USE surface_mod,                                                           &
@@ -798,5 +799,5 @@
  
     INTEGER(iwp)                                                      :: ispec     !> Index to go through the emission chemical species
-
+#if defined( __netcdf )
 
 !-- Actions for initial runs : TBD: needs to be updated
@@ -918,5 +919,5 @@
  IMPLICIT NONE
 
-#if defined( __netcdf )
+
   
     !--- IN/OUT
@@ -983,5 +984,5 @@
     REAL(wp), PARAMETER   ::  ratio2ppm  = 1.0e06_wp  
     !------------------------------------------------------    
-
+#if defined( __netcdf )
     IF ( emission_output_required ) THEN
 
Index: /palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3372)
+++ /palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3373)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! Remove MPI_Abort, replace by message
+!
+! 3318 2018-10-08 11:43:01Z sward
 ! Fixed faulty syntax of message string
 ! 
@@ -176,5 +179,4 @@
 
  MODULE chemistry_model_mod
-    USE MPI
 
     USE kinds,              ONLY: wp, iwp
@@ -1018,7 +1020,8 @@
                      (variable(char_len-2:) == '_xz')               .OR.                              &
                      (variable(char_len-2:) == '_yz') ) )               THEN             
-
-                   IF(myid == 0)  WRITE(6,*) 'Output of species ' // TRIM(variable)  //               &
-                                                            TRIM(chem_species(lsp)%name)       
+!
+!--   todo: remove or replace by "CALL message" mechanism (kanani)
+!                    IF(myid == 0)  WRITE(6,*) 'Output of species ' // TRIM(variable)  //               &
+!                                                             TRIM(chem_species(lsp)%name)       
                 IF (av == 0) THEN
                    DO  i = nxl, nxr
@@ -1096,6 +1099,8 @@
        DO lsp=1,nspec
           IF (TRIM(spec_name) == TRIM(chem_species(lsp)%name))   THEN
-             IF(myid == 0 .AND. chem_debug0 )  WRITE(6,*) 'Output of species ' // TRIM(variable)  //  &
-                                                          TRIM(chem_species(lsp)%name)       
+!
+!--   todo: remove or replace by "CALL message" mechanism (kanani)
+!              IF(myid == 0 .AND. chem_debug0 )  WRITE(6,*) 'Output of species ' // TRIM(variable)  //  &
+!                                                           TRIM(chem_species(lsp)%name)       
              
              IF (av == 0) THEN
@@ -1168,7 +1173,8 @@
        DO lsp=1,nspec
           IF (TRIM(spec_name) == TRIM(chem_species(lsp)%name) )               THEN             
-
-                IF(myid == 0 .AND. chem_debug0 )  WRITE(6,*) 'Output of species ' // TRIM(variable)  // &
-                                                          TRIM(chem_species(lsp)%name)       
+!
+!--   todo: remove or replace by "CALL message" mechanism (kanani)
+!                 IF(myid == 0 .AND. chem_debug0 )  WRITE(6,*) 'Output of species ' // TRIM(variable)  // &
+!                                                           TRIM(chem_species(lsp)%name)       
              IF (av == 0) THEN
                 DO  i = 1, mask_size_l(mid,1)
@@ -1479,4 +1485,6 @@
        DO lsp = 1, nphot
           phot_frequen(lsp)%name = phot_names(lsp)
+!
+!--   todo: remove or replace by "CALL message" mechanism (kanani)
 !         IF( myid == 0 )  THEN
 !            WRITE(6,'(a,i4,3x,a)')  'Photolysis: ',lsp,trim(phot_names(lsp))
@@ -1651,8 +1659,9 @@
              tmp_phot(:,lph) = phot_frequen(lph)%freq(nzb+1:nzt,j,i)               
           ENDDO
-
-          IF(myid == 0 .AND. chem_debug0 ) THEN
-             IF (i == 10 .and. j == 10) WRITE(0,*) 'begin chemics step ',dt_3d
-          ENDIF
+!
+!--   todo: remove (kanani)
+!           IF(myid == 0 .AND. chem_debug0 ) THEN
+!              IF (i == 10 .and. j == 10) WRITE(0,*) 'begin chemics step ',dt_3d
+!           ENDIF
 
 !--       Compute length of time step
@@ -1670,5 +1679,7 @@
              IF( simulated_time <= 2*dt_3d)  THEN
                  rcntrl_local = 0
-                 WRITE(9,'(a,2f10.3)') 'USE Default rcntrl in the first steps ',simulated_time,dt_3d
+!
+!--   todo: remove (kanani)
+!                  WRITE(9,'(a,2f10.3)') 'USE Default rcntrl in the first steps ',simulated_time,dt_3d
              ELSE
                  rcntrl_local = rcntrl
@@ -1845,28 +1856,30 @@
           solver_type = 'Rang3'
        ELSE
-          IF(myid == 0)  write(0,*) 'illegal solver type '     !kk chane to PALM error message
-          call MPI_Abort (MPI_COMM_WORLD, 1, ier)
+           message_string = 'illegal solver type'
+           CALL message( 'chem_parin', 'PA0506', 1, 2, 0, 6, 0 )
        END IF
 
-       write(text,*) 'gas_phase chemistry: solver_type = ',trim(solver_type)
+!
+!--   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
 !kk       CALL location_message( trim(text), .FALSE. )
-       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
+!        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
