Skip to content

Commit

Permalink
Move NRRRR initialisation to cable_driver_init
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Nov 21, 2024
1 parent 6a96697 commit 6c0c386
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/offline/cable_driver_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ MODULE cable_driver_init_mod

CONTAINS

SUBROUTINE cable_driver_init(mpi_grp, trunk_sumbal)
SUBROUTINE cable_driver_init(mpi_grp, trunk_sumbal, NRRRR)
!! Model initialisation routine for the CABLE offline driver.
TYPE(mpi_grp_t), INTENT(IN) :: mpi_grp !! MPI group to use
DOUBLE PRECISION, INTENT(OUT) :: trunk_sumbal
!! Reference value for quasi-bitwise reproducibility checks.
INTEGER, INTENT(OUT) :: NRRRR !! Number of repeated spin-up cycles

INTEGER :: ioerror, unit
CHARACTER(len=4) :: cRank ! for worker-logfiles
Expand Down Expand Up @@ -184,6 +185,8 @@ SUBROUTINE cable_driver_init(mpi_grp, trunk_sumbal)
LALLOC = 3 ! for use with POP: makes use of pipe model to partition between stem and leaf
END IF

NRRRR = MERGE(MAX(cable_user%CASA_NREP,1), 1, CASAONLY)

END SUBROUTINE cable_driver_init

END MODULE cable_driver_init_mod
5 changes: 3 additions & 2 deletions src/offline/cable_offline_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ PROGRAM cable_offline_driver
TYPE(mpi_grp_t) :: mpi_grp
DOUBLE PRECISION :: trunk_sumbal
!! Reference value for quasi-bitwise reproducibility checks.
INTEGER :: NRRRR !! Number of repeated spin-up cycles

call mpi_mod_init()
mpi_grp = mpi_grp_t()

CALL cable_driver_init(mpi_grp, trunk_sumbal)
CALL cable_driver_init(mpi_grp, trunk_sumbal, NRRRR)

IF (mpi_grp%size == 1) THEN
CALL serialdrv(trunk_sumbal)
CALL serialdrv(trunk_sumbal, NRRRR)
ELSE
IF (mpi_grp%rank == 0) THEN
CALL mpidrv_master(mpi_grp%comm, trunk_sumbal)
Expand Down
5 changes: 2 additions & 3 deletions src/offline/cable_serial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ MODULE cable_serial

CONTAINS

SUBROUTINE serialdrv(trunk_sumbal)
SUBROUTINE serialdrv(trunk_sumbal, NRRRR)
!! Offline serial driver.
DOUBLE PRECISION, INTENT(IN) :: trunk_sumbal
!! Reference value for quasi-bitwise reproducibility checks.
INTEGER, INTENT(IN) :: NRRRR !! Number of repeated spin-up cycles

! timing variables
INTEGER, PARAMETER :: kstart = 1 ! start of simulation
Expand All @@ -176,7 +177,6 @@ SUBROUTINE serialdrv(trunk_sumbal)
YYYY, & !
RYEAR, & !
RRRR, & !
NRRRR, & !
ctime, & ! day count for casacnp
LOY, & ! days in year
count_sum_casa ! number of time steps over which casa pools &
Expand Down Expand Up @@ -302,7 +302,6 @@ SUBROUTINE serialdrv(trunk_sumbal)
cable_user%MetType = 'gswp'
ENDIF

NRRRR = MERGE(MAX(CABLE_USER%CASA_NREP,1), 1, CASAONLY)
! casa time count
ctime = 0

Expand Down

0 comments on commit 6c0c386

Please sign in to comment.