diff --git a/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml new file mode 100644 index 000000000..b5730d686 --- /dev/null +++ b/ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml @@ -0,0 +1,96 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rrtmg_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_cice + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + + + mp_thompson + + + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + + + + + GFS_stochastics + phys_tend + + + + diff --git a/ccpp/suites/suite_FV3_GFS_v17_p8.xml b/ccpp/suites/suite_FV3_GFS_v17_p8.xml new file mode 100644 index 000000000..10d4e8c19 --- /dev/null +++ b/ccpp/suites/suite_FV3_GFS_v17_p8.xml @@ -0,0 +1,95 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rrtmg_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + + + mp_thompson + + + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + + + + + GFS_stochastics + phys_tend + + + + diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 7fe309d3f..9c67f254c 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -86,7 +86,7 @@ module module_fcst_grid_comp integer :: ngrids, mygrid integer,dimension(:),allocatable :: grid_number_on_all_pets(:) - integer :: num_atmos_calls, intrm_rst + integer :: intrm_rst, n_atmsteps !----- coupled model data ----- @@ -324,10 +324,8 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) ! type(ESMF_VM) :: VM type(ESMF_Time) :: CurrTime, StartTime, StopTime - type(ESMF_TimeInterval) :: RunDuration type(ESMF_Config) :: cf - integer :: Run_length integer,dimension(6) :: date, date_end ! character(len=9) :: month @@ -523,19 +521,11 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) endif ! fexist endif ! mype == 0 - RunDuration = StopTime - CurrTime - - CALL ESMF_TimeIntervalGet(RunDuration, S=Run_length, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return -! call diag_manager_init (TIME_INIT=date) call diag_manager_set_time_end(Time_end) ! Time_step = set_time (dt_atmos,0) - num_atmos_calls = Run_length / dt_atmos - if (mype == 0) write(*,*)'num_atmos_calls=',num_atmos_calls,'time_init=', & - date_init,'time=',date,'time_end=',date_end,'dt_atmos=',dt_atmos, & - 'Run_length=',Run_length + if (mype == 0) write(*,*)'time_init=', date_init,'time=',date,'time_end=',date_end,'dt_atmos=',dt_atmos ! set up forecast time array that controls when to write out restart files frestart = 0 @@ -588,6 +578,13 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) ! if to write out restart at the end of forecast restart_endfcst = .false. if ( ANY(frestart(:) == total_inttime) ) restart_endfcst = .true. +! frestart only contains intermediate restart + do i=1,size(frestart) + if(frestart(i) == total_inttime) then + frestart(i) = 0 + exit + endif + enddo if (mype == 0) print *,'frestart=',frestart(1:10)/3600, 'restart_endfcst=',restart_endfcst, & 'total_inttime=',total_inttime ! if there is restart writing during integration @@ -946,8 +943,7 @@ subroutine fcst_run_phase_1(fcst_comp, importState, exportState,clock,rc) ! !*** local variables ! - integer :: mype, na - integer(kind=ESMF_KIND_I8) :: ntimestep_esmf + integer :: mype, seconds real(kind=8) :: mpi_wtime, tbeg1 ! !----------------------------------------------------------------------- @@ -961,11 +957,9 @@ subroutine fcst_run_phase_1(fcst_comp, importState, exportState,clock,rc) ! call ESMF_GridCompGet(fcst_comp, localpet=mype, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return -! - call ESMF_ClockGet(clock, advanceCount=NTIMESTEP_ESMF, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - na = NTIMESTEP_ESMF + call get_time(Atmos%Time - Atmos%Time_init, seconds) + n_atmsteps = seconds/dt_atmos ! !----------------------------------------------------------------------- ! *** call fcst integration subroutines @@ -977,7 +971,7 @@ subroutine fcst_run_phase_1(fcst_comp, importState, exportState,clock,rc) call atmos_model_exchange_phase_1 (Atmos, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - if (mype == 0) write(*,*)"PASS: fcstRUN phase 1, na = ",na, ' time is ', mpi_wtime()-tbeg1 + if (mype == 0) write(*,*)"PASS: fcstRUN phase 1, n_atmsteps = ",n_atmsteps, ' time is ', mpi_wtime()-tbeg1 ! !----------------------------------------------------------------------- ! @@ -1000,8 +994,7 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) ! !*** local variables ! - integer :: mype, na, date(6), seconds - integer(kind=ESMF_KIND_I8) :: ntimestep_esmf + integer :: mype, date(6), seconds character(len=64) :: timestamp integer :: unit real(kind=8) :: mpi_wtime, tbeg1 @@ -1017,11 +1010,6 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) ! call ESMF_GridCompGet(fcst_comp, localpet=mype, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - - call ESMF_ClockGet(clock, advanceCount=NTIMESTEP_ESMF, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - - na = NTIMESTEP_ESMF ! !----------------------------------------------------------------------- ! *** call fcst integration subroutines @@ -1034,35 +1022,33 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) !--- intermediate restart if (intrm_rst>0) then - if (na /= num_atmos_calls-1) then - call get_time(Atmos%Time - Atmos%Time_init, seconds) - if (ANY(frestart(:) == seconds)) then - if (mype == 0) write(*,*)'write out restart at na=',na,' seconds=',seconds, & - 'integration lenght=',na*dt_atmos/3600. - - timestamp = date_to_string (Atmos%Time) - call atmos_model_restart(Atmos, timestamp) - call write_stoch_restart_atm('RESTART/'//trim(timestamp)//'.atm_stoch.res.nc') - - !----- write restart file ------ - if (mpp_pe() == mpp_root_pe())then - call get_date (Atmos%Time, date(1), date(2), date(3), & - date(4), date(5), date(6)) - call mpp_open( unit, 'RESTART/'//trim(timestamp)//'.coupler.res', nohdrs=.TRUE. ) - write( unit, '(i6,8x,a)' )calendar_type, & - '(Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)' - - write( unit, '(6i6,8x,a)' )date_init, & - 'Model start time: year, month, day, hour, minute, second' - write( unit, '(6i6,8x,a)' )date, & - 'Current model time: year, month, day, hour, minute, second' - call mpp_close(unit) - endif + call get_time(Atmos%Time - Atmos%Time_init, seconds) + if (ANY(frestart(:) == seconds)) then + if (mype == 0) write(*,*)'write out restart at n_atmsteps=',n_atmsteps,' seconds=',seconds, & + 'integration length=',n_atmsteps*dt_atmos/3600. + + timestamp = date_to_string (Atmos%Time) + call atmos_model_restart(Atmos, timestamp) + call write_stoch_restart_atm('RESTART/'//trim(timestamp)//'.atm_stoch.res.nc') + + !----- write restart file ------ + if (mpp_pe() == mpp_root_pe())then + call get_date (Atmos%Time, date(1), date(2), date(3), & + date(4), date(5), date(6)) + call mpp_open( unit, 'RESTART/'//trim(timestamp)//'.coupler.res', nohdrs=.TRUE. ) + write( unit, '(i6,8x,a)' )calendar_type, & + '(Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)' + + write( unit, '(6i6,8x,a)' )date_init, & + 'Model start time: year, month, day, hour, minute, second' + write( unit, '(6i6,8x,a)' )date, & + 'Current model time: year, month, day, hour, minute, second' + call mpp_close(unit) endif endif endif - if (mype == 0) write(*,*)"PASS: fcstRUN phase 2, na = ",na, ' time is ', mpi_wtime()-tbeg1 + if (mype == 0) write(*,*)"PASS: fcstRUN phase 2, n_atmsteps = ",n_atmsteps, ' time is ', mpi_wtime()-tbeg1 ! !----------------------------------------------------------------------- !