From d1a8707797c5c3fabdbd530210b84b85fb18b258 Mon Sep 17 00:00:00 2001
From: Sabine <sabine.eckhardt@nilu.no>
Date: Thu, 4 May 2017 11:29:58 +0200
Subject: [PATCH] When running in wet deposition mode a textfile with
 precipitation data is written out

---
 src/getfields.f90   | 8 ++++++++
 src/makefile        | 2 ++
 src/par_mod.f90     | 2 +-
 src/timemanager.f90 | 2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/getfields.f90 b/src/getfields.f90
index fc406148..bfc24d25 100644
--- a/src/getfields.f90
+++ b/src/getfields.f90
@@ -137,6 +137,10 @@ subroutine getfields(itime,nstop)
     end do
 40  indmin=indj
 
+   if (WETBKDEP) then
+        call writeprecip(itime,memind(1))
+   endif
+
   else
 
 ! No wind fields, which can be used, are currently in memory
@@ -168,6 +172,10 @@ subroutine getfields(itime,nstop)
     end do
 60  indmin=indj
 
+   if (WETBKDEP) then
+        call writeprecip(itime,memind(1))
+   endif
+
   endif
 
   lwindinterv=abs(memtime(2)-memtime(1))
diff --git a/src/makefile b/src/makefile
index 35c81e46..7c5d15fb 100644
--- a/src/makefile
+++ b/src/makefile
@@ -143,6 +143,7 @@ OBJECTS_GFS = \
 OBJECTS = \
 advance.o		initialize.o		\
 writeheader.o		writeheader_txt.o  	\
+writeprecip.o \
 writeheader_surf.o     	assignland.o\
 part0.o 		gethourlyOH.o\
 caldate.o               partdep.o \
@@ -431,6 +432,7 @@ wetdepo.o: com_mod.o par_mod.o point_mod.o
 wetdepokernel.o: com_mod.o par_mod.o unc_mod.o
 wetdepokernel_nest.o: com_mod.o par_mod.o unc_mod.o
 writeheader.o: com_mod.o outg_mod.o par_mod.o point_mod.o
+writeprecip.o: com_mod.o par_mod.o point_mod.o
 writeheader_nest.o: com_mod.o outg_mod.o par_mod.o point_mod.o
 writeheader_nest_surf.o: com_mod.o outg_mod.o par_mod.o point_mod.o
 writeheader_surf.o: com_mod.o outg_mod.o par_mod.o point_mod.o
diff --git a/src/par_mod.f90 b/src/par_mod.f90
index 5f457678..0f1a645b 100644
--- a/src/par_mod.f90
+++ b/src/par_mod.f90
@@ -251,7 +251,7 @@ module par_mod
   integer,parameter :: unitspecies=1, unitoutrecept=91, unitoutreceptppt=92
   integer,parameter :: unitlsm=1, unitsurfdata=1, unitland=1, unitwesely=1
   integer,parameter :: unitOH=1
-  integer,parameter :: unitdates=94, unitheader=90,unitheader_txt=100, unitshortpart=95
+  integer,parameter :: unitdates=94, unitheader=90,unitheader_txt=100, unitshortpart=95, unitprecip=101
   integer,parameter :: unitboundcond=89
   integer,parameter :: unittmp=101
 
diff --git a/src/timemanager.f90 b/src/timemanager.f90
index 21f6ca3b..7ae91dbe 100644
--- a/src/timemanager.f90
+++ b/src/timemanager.f90
@@ -147,6 +147,8 @@ subroutine timemanager
 !CGZ-lifetime: set lifetime to 0
   
   if (.not.usekernel) write(*,*) 'Not using the kernel'
+  if (turboff) write(*,*) 'Turbulence switched off'
+
   write(*,46) float(itime)/3600,itime,numpart
 
   if (verbosity.gt.0) then
-- 
GitLab