changeset 85:d0a09535da88

Make restarts possible; rewind diagfq, so use *first* avg timeslice for filename.
author Marco van Hulten <marco@hulten.org>
date Tue, 11 Jun 2019 11:44:18 +0200
parents 6338cd682d54
children 8aa02b933eb8
files beleg_bgc.F90 ini_hamocc.F90 mo_control_bgc.F90 mod_dia.F
diffstat 4 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/beleg_bgc.F90	Fri Jun 07 15:04:22 2019 +0200
+++ b/beleg_bgc.F90	Tue Jun 11 11:44:18 2019 +0200
@@ -85,7 +85,7 @@
 
 #ifdef SED_OFFLINE
       lcompleted_clim  = .false.
-      namelist /bgcnml/ atm_co2, maxyear_sediment, maxyear_ocean,    &
+      namelist /bgcnml/ atm_co2, maxyear_sediment, maxyear_ocean, nburst_last, &
          &              lsed_rclim, lsed_wclim, lsed_spinup
 #else
       namelist /bgcnml/ atm_co2
@@ -111,6 +111,7 @@
 #ifdef SED_OFFLINE
         write(io_stdo_bgc,*) 'HAMOCC: maxyear_sediment =',maxyear_sediment
         write(io_stdo_bgc,*) 'HAMOCC: maxyear_ocean =',maxyear_ocean
+        write(io_stdo_bgc,*) 'HAMOCC: nburst_last =',nburst_last
         write(io_stdo_bgc,*) 'HAMOCC: lsed_rclim =',lsed_rclim
         write(io_stdo_bgc,*) 'HAMOCC: lsed_wclim =',lsed_wclim
         write(io_stdo_bgc,*) 'HAMOCC: lsed_spinup =',lsed_spinup
--- a/ini_hamocc.F90	Fri Jun 07 15:04:22 2019 +0200
+++ b/ini_hamocc.F90	Tue Jun 11 11:44:18 2019 +0200
@@ -152,7 +152,7 @@
 #if defined(SED_OFFLINE)
       nstep_in_month = 0
 #endif
-      nburst = 0
+      nburst = nburst_last
       nyear_global = nyear
       if (mnproc == 1) write(io_stdo_bgc,'(a,i6)')                      &
             &         'ini_hamocc(): nyear_global = ', nyear_global
--- a/mo_control_bgc.F90	Fri Jun 07 15:04:22 2019 +0200
+++ b/mo_control_bgc.F90	Tue Jun 11 11:44:18 2019 +0200
@@ -53,6 +53,7 @@
       INTEGER :: nstep_in_month   !  accumulation counter for SED_OFFLINE.
       INTEGER :: maxyear_sediment !  number of years for off-line sediment integration.
       INTEGER :: maxyear_ocean    !  number of years for full MICOM-HAMOCC integration.
+      INTEGER :: nburst_last      !  nburst from the end of the previous simulation (startup: 0).
       LOGICAL :: lsed_rclim       !  whether to read bottom seawater climatology from file (nml).
       LOGICAL :: lsed_wclim       !  whether to write bottom seawater climatology to file (nml).
       LOGICAL :: lsed_spinup      !  whether to spin up the sediment (nml).
--- a/mod_dia.F	Fri Jun 07 15:04:22 2019 +0200
+++ b/mod_dia.F	Tue Jun 11 11:44:18 2019 +0200
@@ -265,34 +265,29 @@
      .        runid(1:runid_len),'_',ctag,'_',ny,'.',nm,'.',nd,'.nc'
           endif
         elseif (expcnf.eq.'cesm') then
+          call pstdat(ny,nm,nd,nint(diagfq))
           if (filemon) then
             if ( lspinning_up_sed ) then
-               call pstdat(ny,nm,nd,nint(diagfq-filefq))
                write(fname,'(4a,i6.6,a,i2.2,a)')
      .           runid(1:runid_len),'.micom.',ctag,'.',ny,'-',nm,'.nc'
             else
-               call pstdat(ny,nm,nd,nint(diagfq-filefq))
                write(fname,'(4a,i4.4,a,i2.2,a)')
      .           runid(1:runid_len),'.micom.',ctag,'.',ny,'-',nm,'.nc'
             endif
           elseif (fileann .or. filedec .or. filecen .or. filemil) then
             if ( lspinning_up_sed ) then
-               call pstdat(ny,nm,nd,nint(diagfq-filefq))
                write(fname,'(4a,i6.6,a)')
      .           runid(1:runid_len),'.micom.',ctag,'.',ny,'.nc'
             else
-               call pstdat(ny,nm,nd,nint(diagfq-filefq))
                write(fname,'(4a,i4.4,a)')
      .           runid(1:runid_len),'.micom.',ctag,'.',ny,'.nc'
             endif
           else
             if ( lspinning_up_sed ) then
-               call pstdat(ny,nm,nd,nint(diagfq-filefq))
                write(fname,'(4a,i6.6,a,i2.2,a,i2.2,a)')
      .           runid(1:runid_len),'.micom.',ctag,'.',ny,'-',nm,'-',nd,
      .           '.nc'
             else
-               call pstdat(ny,nm,nd,nint(diagfq-filefq))
                write(fname,'(4a,i4.4,a,i2.2,a,i2.2,a)')
      .           runid(1:runid_len),'.micom.',ctag,'.',ny,'-',nm,'-',nd,
      .           '.nc'