From ba2e2be4c779230257a6a859aeaded8cfa5c8b30 Mon Sep 17 00:00:00 2001
From: Thomas Jahns <jahns@dkrz.de>
Date: Fri, 15 Jun 2018 11:01:59 +0200
Subject: [PATCH] Fix trailing whitespace and shorten expression.

---
 examples/simulate_iau.f90 | 36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/examples/simulate_iau.f90 b/examples/simulate_iau.f90
index 3867c408..afa60a9c 100644
--- a/examples/simulate_iau.f90
+++ b/examples/simulate_iau.f90
@@ -4,45 +4,41 @@ program simulate_iau
   use mtime_hl
 
   implicit none
-  
+
   type(t_datetime)  :: start_date, stop_date, current_date, previous_date
-  type(t_timedelta) :: time_step, iau_time_shift 
+  type(t_timedelta) :: time_step, iau_time_shift
 
-  logical :: iterate_iau = .true.
+  logical, parameter :: iterate_iau = .TRUE.
   integer :: iau_iter
 
-  real :: dt_shift, dtime 
+  real :: dt_shift, dtime
 
   integer :: jstep, jstep0, jstep_shift
 
   write (0,*) "Start execution, set calendar ..."
 
   call setCalendar(proleptic_gregorian)
-  
+
   write (0,*) "Assign values ..."
-  
+
   start_date = t_datetime("2016-01-01T00:00:00")
-  stop_date  = t_datetime("2016-01-02T00:00:00")  
+  stop_date  = t_datetime("2016-01-02T00:00:00")
 
   time_step = t_timedelta("PT15M")
   dtime = 900.0
-  
+
   iau_time_shift = t_timedelta("-PT1H30M")
   dt_shift = -5400.0
 
   write (0,*) "Prepare time loop ..."
-  
+
   current_date = start_date
   current_date = current_date + iau_time_shift
 
   write (0,*) '           start date ', start_date%to_string()
   write (0,*) '   shifted start date ', current_date%to_string()
-  
-  if (iterate_iau) then
-    iau_iter = 1
-  else
-    iau_iter = 0
-  endif
+
+  iau_iter = MERGE(1, 0, iterate_iau)
 
   if (iterate_iau) then
     jstep_shift = nint(dt_shift/dtime)
@@ -51,28 +47,28 @@ program simulate_iau
   endif
 
   previous_date = current_date
-  
+
   jstep0 = 0
   jstep = (jstep0 + 1) + jstep_shift
 
   write (0,*) "Start time loop ..."
-  
+
   time_loop: do
 
     current_date = current_date + time_step
 
     write (0,*) "   Time loop ", current_date%to_string(), jstep
-    
+
     if ( (current_date%day() /= previous_date%day()) .and. .not. (jstep == 0 .and. iau_iter == 1) ) then
       previous_date = current_date
     endif
-    
+
     write (0,*) '   --- integrate nh input: ', current_date%to_string(), jstep-jstep_shift, iau_iter
 
     if (current_date >= stop_date) then
       exit time_loop
     end if
-    
+
     if (jstep == 0 .and. iau_iter == 1) then
       iau_iter = 2
       jstep = (jstep0 + 1) + jstep_shift
-- 
GitLab