Skip to content

Commit

Permalink
introduce cime_run(ntsteps), callable for TSMP-PDAF
Browse files Browse the repository at this point in the history
1. re-introduce `private` statement, this was removed because
variables from `cime_comp_mod` had to be used by TSMP-PDAF

2. Add `cime_run` with number of time steps `ntsteps` as
input. `ntsteps` is supplied by the TSMP-PDAF interface.

3. Add `stop_alarm` for `cime_run` dependent on `ntsteps`.
  • Loading branch information
jjokella committed Jun 19, 2024
1 parent a05d2e7 commit ebc7ab1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/drivers/mct/main/cime_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ module cime_comp_mod

implicit none

#ifndef USE_PDAF
private
#endif

public cime_pre_init1, cime_pre_init2, cime_init, cime_run, cime_final
public timing_dir, mpicom_GLOID
Expand Down Expand Up @@ -2188,12 +2186,21 @@ end subroutine cime_init
!*******************************************************************************
!===============================================================================

#ifdef USE_PDAF
subroutine cime_run(ntsteps)
#else
subroutine cime_run()
#endif
use seq_comm_mct, only: atm_layout, lnd_layout, ice_layout, glc_layout, &
rof_layout, ocn_layout, wav_layout, esp_layout
use shr_string_mod, only: shr_string_listGetIndexF
use seq_comm_mct, only: num_inst_driver

#ifdef USE_PDAF
! TSMP specific
integer, intent(in), optional :: ntsteps
integer :: counter=0
#endif
! gptl timer lookup variables
integer, parameter :: hashcnt=7
integer :: hashint(hashcnt)
Expand Down Expand Up @@ -4088,6 +4095,13 @@ subroutine cime_run()
call t_drvstopf ('CPL:BARRIERALARM',cplrun=.true.)
endif

#ifdef USE_PDAF
! TSMP specific stop condition:
counter = counter + 1
if (present(ntsteps) .and. counter == ntsteps) then
stop_alarm = .true.
end if
#endif
enddo ! driver run loop

!|----------------------------------------------------------
Expand Down

0 comments on commit ebc7ab1

Please sign in to comment.