Index: src/concoutput_surf.f90
===================================================================
--- src/concoutput_surf.f90	(revision f13406cf18bf27ac76cdb58b9abebb11329d6757)
+++ src/concoutput_surf.f90	(revision 8a65cb0801b09eb0ae933a1afabbe10361a9021b)
@@ -173,5 +173,5 @@
         yl=outlat0+real(jy)*dyout
         xl=(xl-xlon0)/dx
-        yl=(yl-ylat0)/dx
+        yl=(yl-ylat0)/dy
         iix=max(min(nint(xl),nxmin1),0)
         jjy=max(min(nint(yl),nymin1),0)
@@ -311,6 +311,4 @@
 
 
-
-
   !*******************************************************************
   ! Generate output: may be in concentration (ng/m3) or in mixing
@@ -320,4 +318,5 @@
   ! For backward simulations, the unit is seconds, stored in grid_time
   !*******************************************************************
+
   if (verbosity.eq.1) then
      print*,'concoutput_surf 4 (output)'
@@ -328,5 +327,7 @@
   ! Concentration output
   !*********************
+
   if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
+
   if (verbosity.eq.1) then
      print*,'concoutput_surf (Wet deposition)'
@@ -343,5 +344,5 @@
          do jy=0,numygrid-1
             do ix=0,numxgrid-1
-  !oncentraion greater zero
+  ! concentraion greater zero
               if (wetgrid(ix,jy).gt.smallnum) then
                  if (sp_zer.eqv..true.) then ! first non zero value
@@ -369,6 +370,5 @@
          write(unitoutgrid) sp_count_r
          write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgrid) sp_count_r
-         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
+!         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
 
   if (verbosity.eq.1) then
@@ -411,8 +411,5 @@
          write(unitoutgrid) sp_count_r
          write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgrid) sp_count_r
-         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
-
-
+!         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
 
   if (verbosity.eq.1) then
@@ -421,9 +418,9 @@
      WRITE(*,*) 'SYSTEM_CLOCK',count_clock - count_clock0   
   endif
+
   ! Concentrations
 
-  ! if surf_only write only 1st layer 
-
-         if(surf_only.eq.1) then
+  ! surf_only write only 1st layer 
+
          sp_count_i=0
          sp_count_r=0
@@ -440,5 +437,5 @@
                     sp_zer=.false.
                     sp_fact=sp_fact*(-1.)
-                   endif
+                  endif
                    sp_count_r=sp_count_r+1
                    sparse_dump_r(sp_count_r)= &
@@ -451,65 +448,17 @@
                         gridsigma(ix,jy,kz)* &
                         factor3d(ix,jy,kz)/tot_mu(ks,kp)
-              else ! concentration is zero
+                else ! concentration is zero
                   sp_zer=.true.
-              endif
-              end do
-            end do
-          end do
+                endif
+             end do
+           end do
+         end do
          write(unitoutgrid) sp_count_i
          write(unitoutgrid) (sparse_dump_i(i),i=1,sp_count_i)
          write(unitoutgrid) sp_count_r
          write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgrid) sp_count_r
-         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
-         else
-
-  ! write full vertical resolution
-  if (verbosity.eq.1) then
-     print*,'concoutput_surf (write full vertical resolution)'
-     CALL SYSTEM_CLOCK(count_clock)
-     WRITE(*,*) 'SYSTEM_CLOCK',count_clock - count_clock0   
-  endif
-
-         sp_count_i=0
-         sp_count_r=0
-         sp_fact=-1.
-         sp_zer=.true.
-          do kz=1,numzgrid
-            do jy=0,numygrid-1
-              do ix=0,numxgrid-1
-                if (grid(ix,jy,kz).gt.smallnum) then
-                  if (sp_zer.eqv..true.) then ! first non zero value
-                    sp_count_i=sp_count_i+1
-                    sparse_dump_i(sp_count_i)= &
-                         ix+jy*numxgrid+kz*numxgrid*numygrid
-                    sp_zer=.false.
-                    sp_fact=sp_fact*(-1.)
-                   endif
-                   sp_count_r=sp_count_r+1
-                   sparse_dump_r(sp_count_r)= &
-                        sp_fact* &
-                        grid(ix,jy,kz)* &
-                        factor3d(ix,jy,kz)/tot_mu(ks,kp)
-  !                 if ((factor(ix,jy,kz)/tot_mu(ks,kp)).eq.0)
-  !    +              write (*,*) factor(ix,jy,kz),tot_mu(ks,kp),ks,kp
-                   sparse_dump_u(sp_count_r)= &
-                        gridsigma(ix,jy,kz)* &
-                        factor3d(ix,jy,kz)/tot_mu(ks,kp)
-              else ! concentration is zero
-                  sp_zer=.true.
-              endif
-              end do
-            end do
-          end do
-         write(unitoutgrid) sp_count_i
-         write(unitoutgrid) (sparse_dump_i(i),i=1,sp_count_i)
-         write(unitoutgrid) sp_count_r
-         write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgrid) sp_count_r
-         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)         
-         endif ! surf_only
-
-    endif !  concentration output
+!         write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
+
+  endif !  concentration output
 
   ! Mixing ratio output
@@ -553,6 +502,5 @@
          write(unitoutgridppt) sp_count_r
          write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgridppt) sp_count_r
-         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
+!         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
 
 
@@ -592,13 +540,11 @@
          write(unitoutgridppt) sp_count_r
          write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgridppt) sp_count_r
-         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
+!         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
 
 
   ! Mixing ratios
 
-  ! if surf_only write only 1st layer 
-
-         if(surf_only.eq.1) then
+  ! surf_only write only 1st layer 
+
          sp_count_i=0
          sp_count_r=0
@@ -636,48 +582,5 @@
          write(unitoutgridppt) sp_count_r
          write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgridppt) sp_count_r
-         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
-         else
-
-  ! write full vertical resolution
-
-         sp_count_i=0
-         sp_count_r=0
-         sp_fact=-1.
-         sp_zer=.true.
-          do kz=1,numzgrid
-            do jy=0,numygrid-1
-              do ix=0,numxgrid-1
-                if (grid(ix,jy,kz).gt.smallnum) then
-                  if (sp_zer.eqv..true.) then ! first non zero value
-                    sp_count_i=sp_count_i+1
-                    sparse_dump_i(sp_count_i)= &
-                         ix+jy*numxgrid+kz*numxgrid*numygrid
-                    sp_zer=.false.
-                    sp_fact=sp_fact*(-1.)
-                 endif
-                 sp_count_r=sp_count_r+1
-                 sparse_dump_r(sp_count_r)= &
-                      sp_fact* &
-                      1.e12*grid(ix,jy,kz) &
-                      /volume(ix,jy,kz)/outnum* &
-                      weightair/weightmolar(ks)/densityoutgrid(ix,jy,kz)
-                 sparse_dump_u(sp_count_r)= &
-                      1.e12*gridsigma(ix,jy,kz)/volume(ix,jy,kz)/ &
-                      outnum*weightair/weightmolar(ks)/ &
-                      densityoutgrid(ix,jy,kz)
-              else ! concentration is zero
-                  sp_zer=.true.
-              endif
-              end do
-            end do
-          end do
-         write(unitoutgridppt) sp_count_i
-         write(unitoutgridppt) (sparse_dump_i(i),i=1,sp_count_i)
-         write(unitoutgridppt) sp_count_r
-         write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
-!         write(unitoutgridppt) sp_count_r
-         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
-         endif ! surf_only
+!         write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
 
       endif ! output for ppt
