Skip to content

Commit

Permalink
Merge pull request NCAR#7 from climbfuji/bugfix_b4b_identical_restarts
Browse files Browse the repository at this point in the history
Bugfix for bit-for-bit identical restart runs
  • Loading branch information
DomHeinzeller authored Jan 12, 2020
2 parents 0dcce97 + a15f74b commit af8915b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,6 @@ subroutine update_atmos_radiation_physics (Atmos)
call atmos_phys_driver_statein (IPD_data, Atm_block, flip_vc)
call mpp_clock_end(getClock)

#ifdef CCPP
if (IPD_Control%first_time_step) then
! Initialize the CCPP framework and physics
call CCPP_step (step="init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP init step failed')
call CCPP_step (step="physics_init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP physics_init step failed')
end if
#endif

!--- if dycore only run, set up the dummy physics output state as the input state
if (dycore_only) then
do nb = 1,Atm_block%nblks
Expand Down Expand Up @@ -686,6 +676,18 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain)
#endif

#ifdef CCPP
! Populate the IPD_Data%Statein container with the prognostic state
! in Atm_block, which contains the initial conditions/restart data.
call atmos_phys_driver_statein (IPD_data, Atm_block, flip_vc)
! Initialize the CCPP framework
call CCPP_step (step="init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP init step failed')
! Initialize the CCPP physics
call CCPP_step (step="physics_init", nblks=Atm_block%nblks, ierr=ierr)
if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP physics_init step failed')
#endif

!--- set the initial diagnostic timestamp
diag_time = Time
if (output_1st_tstep_rst) then
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics

0 comments on commit af8915b

Please sign in to comment.