changeset 70:0cb9809001b1

Fixed timestep (division by zero) issue due to using both module and #include; and relaxed/fixed start of year checking for MICOM/HAMOCC consistency with off-line sediment.
author Marco van Hulten <marco@hulten.org>
date Tue, 26 Mar 2019 14:56:10 +0100
parents d1759c75f997
children e9fe6d58940d
files hamocc_init.F hamocc_step.F ini_hamocc.F90
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hamocc_init.F	Tue Mar 26 14:51:02 2019 +0100
+++ b/hamocc_init.F	Tue Mar 26 14:56:10 2019 +0100
@@ -4,6 +4,7 @@
 c
       use mod_xc
       use mo_param1_bgc, only: ks,nsedtra,npowtra
+      use mo_common_bgc
 #ifdef DIFFAT
       use mo_satm
 #endif
@@ -11,7 +12,6 @@
       implicit none
 c
 #include "param_trc.h"
-#include "common_bgc.h"
 #include "common_bgcs.h"
 #include "common_blocks.h"
 #include "common_clndr.h"
--- a/hamocc_step.F	Tue Mar 26 14:51:02 2019 +0100
+++ b/hamocc_step.F	Tue Mar 26 14:56:10 2019 +0100
@@ -40,7 +40,8 @@
      .                    bgc_dp, bgc_dx, bgc_dy, omask)
 #endif
 
-      if ( nday_of_year==1 .and. is_start_of_day ) then
+      ! January 2 to make it work with MICOM clock for a startup run
+      if ( nday_of_year==2 .and. is_start_of_day ) then
          nyear_global = nyear_global + 1
          if (mnproc.eq.1) write(io_stdo_bgc,'(a,i6)')
      .            'hamocc_step(): nyear_global = ', nyear_global
@@ -56,7 +57,8 @@
 #ifdef SED_OFFLINE
       ! accumulate bottom water tracers when in
       ! the last year of MICOM/HAMOCC simulation
-      if ( (lsed_wclim .or. lsed_spinup) .and. mod(nyear,maxyear_ocean)==0 ) then
+      if ( (lsed_wclim .or. lsed_spinup) .and. mod(nyear,maxyear_ocean)==0
+     .     .and. .not. nyear_global==0 ) then
          call prepare_clim(nstep)
       endif
 #endif
--- a/ini_hamocc.F90	Tue Mar 26 14:51:02 2019 +0100
+++ b/ini_hamocc.F90	Tue Mar 26 14:56:10 2019 +0100
@@ -131,9 +131,10 @@
       ndtdayoff=86400./dtoff           !  time steps per day [No].
       dto=1./ndtdayoff                 !  time step length [days].
 
-      if (.not. (kplmonth==1 .and. kplday==1)) then
-         write(io_stdo_bgc,*) 'WARNING: Not at start of year! The transition &
-            & between stand-alone and coupled sediment will be inconsistent!'
+      if (.not. (kplmonth==1 .and. kplday<=2 .and. lsed_rclim==.true.)) then
+         write(io_stdo_bgc,*) 'WARNING: Not at start of year! &
+            &                  The transition between stand-alone and'
+         write(io_stdo_bgc,*) 'coupled sediment will be inconsistent!'
       endif
 #endif