Index: trunk/src/FLEXPART.f90
===================================================================
--- trunk/src/FLEXPART.f90	(revision 30)
+++ trunk/src/FLEXPART.f90	(revision 20)
@@ -45,9 +45,4 @@
   use conv_mod
 
-#ifdef NETCDF_OUTPUT
-  use netcdf_output_mod, only: writeheader_netcdf
-#endif
-
-
   implicit none
 
@@ -65,8 +60,7 @@
   call gasdev1(idummy,rannumb(maxrand),rannumb(maxrand-1))
 
-  ! FLEXPART version string
-  flexversion='Version 9.2 beta (2014-07-01)'
-  verbosity=0
-
+  ! 
+  flexversion='Version 9.1.8  (2013-12-08)'
+  !verbosity=0
   ! Read the pathnames where input/output files are stored
   !*******************************************************
@@ -82,42 +76,48 @@
     call getarg(1,arg1)
     pathfile=arg1
+    verbosity=0
     if (arg1(1:1).eq.'-') then
-      write(pathfile,'(a11)') './pathnames'
-      inline_options=arg1 
+        write(pathfile,'(a11)') './pathnames'
+        inline_options=arg1 
     endif
   case (0)
     write(pathfile,'(a11)') './pathnames'
+    verbosity=0
   end select
   
+    if (inline_options(1:1).eq.'-') then
+      print*, 'inline options=', inline_options       
+      if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then
+         print*, 'verbose mode 1: additional information will be displayed'
+         verbosity=1
+      endif
+      if (trim(inline_options).eq.'-v2') then
+         print*, 'verbose mode 2: additional information will be displayed'
+         verbosity=2
+      endif
+      if (trim(inline_options).eq.'-i') then
+         print*, 'info mode: will provide run specific information and stop'
+         verbosity=1
+         info_flag=1
+      endif
+      if (trim(inline_options).eq.'-i2') then
+         print*, 'info mode: will provide run specific information and stop'
+         verbosity=2
+         info_flag=1
+      endif
+    endif
+
+
   ! Print the GPL License statement
   !*******************************************************
-  print*,'Welcome to FLEXPART ', trim(flexversion)
-  print*,'FLEXPART is free software released under the GNU General Public License.'
- 
-  if (inline_options(1:1).eq.'-') then
-    if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then
-       print*, 'Verbose mode 1: display detailed information during run'
-       verbosity=1
-    endif
-    if (trim(inline_options).eq.'-v2') then
-       print*, 'Verbose mode 2: display more detailed information during run'
-       verbosity=2
-    endif
-    if (trim(inline_options).eq.'-i') then
-       print*, 'Info mode: provide detailed run specific information and stop'
-       verbosity=1
-       info_flag=1
-    endif
-    if (trim(inline_options).eq.'-i2') then
-       print*, 'Info mode: provide more detailed run specific information and stop'
-       verbosity=2
-       info_flag=1
-    endif
-  endif
-           
-  if (verbosity.gt.0) then
-    write(*,*) 'call readpaths'
+  print*,'Welcome to FLEXPART', trim(flexversion)
+  print*,'FLEXPART is free software released under the GNU Genera'// &
+       'l Public License.'
+            
+  if (verbosity.gt.0) then
+        WRITE(*,*) 'call readpaths'
   endif 
   call readpaths(pathfile)
+   
  
   if (verbosity.gt.1) then !show clock info 
@@ -131,32 +131,36 @@
   endif
 
+
   ! Read the user specifications for the current model run
   !*******************************************************
 
   if (verbosity.gt.0) then
-    write(*,*) 'call readcommand'
+        WRITE(*,*) 'call readcommand'
   endif
   call readcommand
   if (verbosity.gt.0) then
-    write(*,*) '    ldirect=', ldirect
-    write(*,*) '    ibdate,ibtime=',ibdate,ibtime
-    write(*,*) '    iedate,ietime=', iedate,ietime
-    if (verbosity.gt.1) then   
-      CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
-      write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
-    endif     
-  endif
+        WRITE(*,*) '    ldirect=', ldirect
+        WRITE(*,*) '    ibdate,ibtime=',ibdate,ibtime
+        WRITE(*,*) '    iedate,ietime=', iedate,ietime
+        if (verbosity.gt.1) then   
+                CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
+                WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
+        endif     
+  endif
+
 
   ! Read the age classes to be used
   !********************************
   if (verbosity.gt.0) then
-    write(*,*) 'call readageclasses'
+        WRITE(*,*) 'call readageclasses'
   endif
   call readageclasses
 
   if (verbosity.gt.1) then   
-    CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
-    write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
+                CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
+                WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
   endif     
+ 
+
 
   ! Read, which wind fields are available within the modelling period
@@ -164,5 +168,5 @@
 
   if (verbosity.gt.0) then
-    write(*,*) 'call readavailable'
+        WRITE(*,*) 'call readavailable'
   endif  
   call readavailable
@@ -173,5 +177,5 @@
  
   if (verbosity.gt.0) then
-     write(*,*) 'call gridcheck'
+     WRITE(*,*) 'call gridcheck'
   endif
 
@@ -179,18 +183,20 @@
 
   if (verbosity.gt.1) then   
-    CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
-    write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
+     CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
+     WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
   endif      
-
-  if (verbosity.gt.0) then
-    write(*,*) 'call gridcheck_nests'
+  
+
+  if (verbosity.gt.0) then
+        WRITE(*,*) 'call gridcheck_nests'
   endif  
   call gridcheck_nests
 
+
   ! Read the output grid specifications
   !************************************
 
   if (verbosity.gt.0) then
-    write(*,*) 'call readoutgrid'
+        WRITE(*,*) 'call readoutgrid'
   endif
 
@@ -198,7 +204,7 @@
 
   if (nested_output.eq.1) then
-    call readoutgrid_nest
+          call readoutgrid_nest
     if (verbosity.gt.0) then
-      write(*,*) '# readoutgrid_nest'
+        WRITE(*,*) '# readoutgrid_nest'
     endif
   endif
@@ -226,4 +232,5 @@
   call readlanduse
 
+
   ! Assign fractional cover of landuse classes to each ECMWF grid point
   !********************************************************************
@@ -234,4 +241,6 @@
   call assignland
 
+
+
   ! Read the coordinates of the release locations
   !**********************************************
@@ -242,4 +251,5 @@
   call readreleases
 
+
   ! Read and compute surface resistances to dry deposition of gases
   !****************************************************************
@@ -257,4 +267,5 @@
     print*,'call coordtrafo'
   endif
+
 
   ! Initialize all particles to non-existent
@@ -284,8 +295,10 @@
   endif
 
+
   ! Calculate volume, surface area, etc., of all output grid cells
   ! Allocate fluxes and OHfield if necessary
   !***************************************************************
 
+
   if (verbosity.gt.0) then
     print*,'call outgrid_init'
@@ -294,4 +307,5 @@
   if (nested_output.eq.1) call outgrid_init_nest
 
+
   ! Read the OH field
   !******************
@@ -299,7 +313,7 @@
   if (OHREA.eqv..TRUE.) then
     if (verbosity.gt.0) then
-      print*,'call readOHfield'
+       print*,'call readOHfield'
     endif
-    call readOHfield
+       call readOHfield
   endif
 
@@ -308,21 +322,4 @@
   !******************************************************************
 
-  if (lnetcdfout.eq.1) then 
-#ifdef NETCDF_OUTPUT
-    call writeheader_netcdf(lnest = .false.)
-#endif
-  else 
-    call writeheader
-  end if
-
-  if (nested_output.eq.1) then
-    if (lnetcdfout.eq.1) then
-#ifdef NETCDF_OUTPUT
-      call writeheader_netcdf(lnest = .true.)
-#endif
-    else
-      call writeheader_nest
-    endif
-  endif
 
   if (verbosity.gt.0) then
@@ -335,10 +332,11 @@
   !if (nested_output.eq.1) call writeheader_nest
   if (nested_output.eq.1.and.surf_only.ne.1) call writeheader_nest
+
   if (nested_output.eq.1.and.surf_only.eq.1) call writeheader_nest_surf
   if (nested_output.ne.1.and.surf_only.eq.1) call writeheader_surf
 
-  if (lnetcdfout.ne.1) then
-    open(unitdates,file=path(2)(1:length(2))//'dates')
-  end if
+
+
+  !open(unitdates,file=path(2)(1:length(2))//'dates')
 
   if (verbosity.gt.0) then
@@ -348,4 +346,5 @@
   if ((iout.eq.4).or.(iout.eq.5)) call openouttraj
 
+
   ! Releases can only start and end at discrete times (multiples of lsynctime)
   !***************************************************************************
@@ -355,7 +354,10 @@
   endif
   do i=1,numpoint
-    ireleasestart(i)=nint(real(ireleasestart(i))/real(lsynctime))*lsynctime
-    ireleaseend(i)=nint(real(ireleaseend(i))/real(lsynctime))*lsynctime
+    ireleasestart(i)=nint(real(ireleasestart(i))/ &
+         real(lsynctime))*lsynctime
+    ireleaseend(i)=nint(real(ireleaseend(i))/ &
+         real(lsynctime))*lsynctime
   end do
+
 
   ! Initialize cloud-base mass fluxes for the convection scheme
@@ -379,4 +381,5 @@
   end do
 
+
   ! Calculate particle trajectories
   !********************************
@@ -384,10 +387,10 @@
   if (verbosity.gt.0) then
      if (verbosity.gt.1) then   
-       call system_clock(count_clock, count_rate, count_max)
-       write(*,*) 'System clock',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
+       CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
+       WRITE(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
      endif
      if (info_flag.eq.1) then
-       print*, 'Info only mode (stop)'    
-       stop
+         print*, 'info only mode (stop)'    
+         stop
      endif
      print*,'call timemanager'
@@ -396,12 +399,7 @@
   call timemanager
 
-  write(*,*) 'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A FLEXPART MODEL RUN!'
-
-  ! output wall time
-  if (verbosity .gt. 0) then
-    call system_clock(count_clock,count_rate)
-    tins=(count_clock - count_clock0)/real(count_rate)
-    print*,'Wall time ',tins,'s, ',tins/60,'min, ',tins/3600,'h.'
-  endif
+
+  write(*,*) 'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A FLE&
+       &XPART MODEL RUN!'
 
 end program flexpart
