Skip to content

Commit 4736dd3

Browse files
committed
Small updates for timing statements
1 parent 996e994 commit 4736dd3

1 file changed

Lines changed: 28 additions & 17 deletions

File tree

src/physics/cam/clubb_intr.F90

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
25592559
! MAIN COMPUTATION BEGINS HERE !
25602560
!-----------------------------------------------------------------------------------!
25612561

2562-
call t_startf('clubb_tend_cam:NAR')
2562+
call t_startf('clubb_tend_cam:non_acc_region')
25632563

25642564
! Get indicees for cloud and ice mass and cloud and ice number
25652565
call cnst_get_ind('Q',ixq)
@@ -2779,7 +2779,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
27792779
! everything within should be functional with the OpenACC code, or be prevented from running
27802780
! with using OpenACC, see the "ifdef _OPENACC" section above for restriction examples
27812781

2782-
call t_stopf('clubb_tend_cam:NAR')
2782+
call t_stopf('clubb_tend_cam:non_acc_region')
27832783
call t_startf('clubb_tend_cam:acc_copyin')
27842784
!$acc data copyin( pdf_params_chnk(lchnk), pdf_params_zm_chnk(lchnk), sclr_idx, &
27852785
!$acc state_loc, state_loc%q, state_loc%u, state_loc%v, state_loc%t, state_loc%pmid, &
@@ -2869,7 +2869,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
28692869
!$acc copyin( hm_metadata, hm_metadata%l_mix_rat_hm ) &
28702870
!$acc create( wphydrometp, wp2hmp, rtphmp_zt, thlphmp_zt )
28712871
call t_stopf('clubb_tend_cam:acc_copyin')
2872-
call t_startf('clubb_tend_cam:ACCR')
2872+
call t_startf('clubb_tend_cam:acc_region')
28732873

28742874
!----------------------------------------- Zeroing -----------------------------------------
28752875

@@ -3213,8 +3213,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
32133213
! IMPORTANT NOTE: do not make any calls that use CLUBB grid-height
32143214
! operators (such as zt2zm_api, etc.) until AFTER the
32153215
! call to setup_grid_heights_api.
3216-
call t_stopf('clubb_tend_cam:ACCR')
3217-
call t_startf('clubb_tend_cam:NAR')
3216+
call t_stopf('clubb_tend_cam:acc_region')
3217+
call t_startf('clubb_tend_cam:non_acc_region')
32183218
!$acc update host( deltaz, zi_g, zt_g, clubb_params, sfc_elevation )
32193219

32203220
! Calculate grid assuming a descending grid (cam grid), since we want to
@@ -3246,15 +3246,15 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
32463246

32473247
! CLUBB's grid data structure (gr) and nu_vert_res_dep contain arrays that need to
32483248
! be copied to the GPU
3249-
call t_stopf('clubb_tend_cam:NAR')
3249+
call t_stopf('clubb_tend_cam:non_acc_region')
32503250
call t_startf('clubb_tend_cam:acc_copyin')
32513251
!$acc data copyin( gr, gr%zm, gr%zt, gr%dzm, gr%dzt, gr%invrs_dzt, gr%invrs_dzm, &
32523252
!$acc gr%weights_zt2zm, gr%weights_zm2zt, &
32533253
!$acc nu_vert_res_dep, nu_vert_res_dep%nu2, nu_vert_res_dep%nu9, &
32543254
!$acc nu_vert_res_dep%nu1, nu_vert_res_dep%nu8, nu_vert_res_dep%nu10, &
32553255
!$acc nu_vert_res_dep%nu6)
32563256
call t_stopf('clubb_tend_cam:acc_copyin')
3257-
call t_startf('clubb_tend_cam:ACCR')
3257+
call t_startf('clubb_tend_cam:acc_region')
32583258
!----------------------------------------- END CLUBB grid initialization -----------------------------------------
32593259

32603260
#ifdef SILHS
@@ -3359,8 +3359,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
33593359
! Other Surface fluxes provided by host model
33603360
if( (cld_macmic_num_steps > 1) .and. clubb_l_intr_sfc_flux_smooth ) then
33613361

3362-
call t_stopf('clubb_tend_cam:ACCR')
3363-
call t_startf('clubb_tend_cam:NAR')
3362+
call t_stopf('clubb_tend_cam:acc_region')
3363+
call t_startf('clubb_tend_cam:non_acc_region')
33643364
!$acc update host( state_loc%u, state_loc%v, state_loc%t, state_loc%pmid, cam_in%wsx, cam_in%wsy )
33653365

33663366
! Adjust surface stresses using winds from the prior macmic iteration
@@ -3376,8 +3376,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
33763376
end do
33773377

33783378
!$acc update device( upwp_sfc, vpwp_sfc )
3379-
call t_stopf('clubb_tend_cam:NAR')
3380-
call t_startf('clubb_tend_cam:ACCR')
3379+
call t_stopf('clubb_tend_cam:non_acc_region')
3380+
call t_startf('clubb_tend_cam:acc_region')
33813381

33823382
else
33833383

@@ -3577,8 +3577,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
35773577

35783578
end if
35793579

3580-
! Advance CLUBB CORE one timestep in the future
3581-
call t_startf('clubb_tend_cam:advance_clubb_core_api')
35823580

35833581
if ( clubb_l_ascending_grid ) then
35843582

@@ -3590,6 +3588,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
35903588
! subroutine (advance_clubb_core). For example, only the pdf_params fields that
35913589
! are used within this subroutine (or used in a subroutine we call) need to
35923590
! be flipped.
3591+
3592+
call t_startf('clubb_tend_cam:ascending_grid_flip')
35933593

35943594
thlm_forcing = thlm_forcing(:,nzt_clubb:1:-1)
35953595
rtm_forcing = rtm_forcing(:,nzt_clubb:1:-1)
@@ -3738,8 +3738,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
37383738
zi_g(:,nzm_clubb:1:-1), zt_g(:,nzt_clubb:1:-1), & ! intent(in)
37393739
gr, err_info ) ! intent(inout)
37403740

3741+
call t_stopf('clubb_tend_cam:ascending_grid_flip')
3742+
37413743
end if
37423744

3745+
! Advance CLUBB CORE one timestep in the future
3746+
call t_startf('clubb_tend_cam:advance_clubb_core_api')
3747+
37433748
! These updates are required because the pbuf variables are dimensioned with pcols, when
37443749
! we only need ncol. This requires us to slice the arrays when inputting to advance_clubb_core_api,
37453750
! which happens on the CPU, so we need the CPU version of these to be correct.
@@ -3807,10 +3812,14 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
38073812
!$acc rtpthlp_pbuf, wpthvp_pbuf, wp2thvp_pbuf, rtpthvp_pbuf, thlpthvp_pbuf, wp2rtp_pbuf, &
38083813
!$acc wp2thlp_pbuf, uprcp_pbuf, vprcp_pbuf, rc_coef_zm_pbuf, wp4_pbuf, wpup2_pbuf, wpvp2_pbuf, &
38093814
!$acc wp2up2_pbuf, wp2vp2_pbuf, ice_supersat_frac_pbuf )
3815+
3816+
call t_stopf('clubb_tend_cam:advance_clubb_core_api')
38103817

38113818

38123819
if ( clubb_l_ascending_grid ) then
38133820

3821+
call t_startf('clubb_tend_cam:ascending_grid_flip')
3822+
38143823
! If running in ascending mode, we flip the arrays before calling advance_clubb_core
38153824
! so we need to flip them back. This section should flip every array that was flipped
38163825
! before the advance_clubb_core call.
@@ -3973,9 +3982,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
39733982
deltaz, zi_g(:,nzm_clubb), zi_g(:,1), & ! intent(in)
39743983
zi_g, zt_g, & ! intent(in)
39753984
gr, err_info ) ! intent(inout)
3985+
3986+
call t_stopf('clubb_tend_cam:ascending_grid_flip')
3987+
39763988
end if
39773989

3978-
call t_stopf('clubb_tend_cam:advance_clubb_core_api')
39793990

39803991
! Note that CLUBB does not produce an error code specific to any column, and
39813992
! one value only for the entire chunk
@@ -4220,7 +4231,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
42204231

42214232
endif
42224233

4223-
call t_stopf('clubb_tend_cam:ACCR')
4234+
call t_stopf('clubb_tend_cam:acc_region')
42244235

42254236
call t_startf('clubb_tend_cam:acc_copyout')
42264237
!$acc end data
@@ -4231,7 +4242,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
42314242
!$acc end data
42324243
call t_stopf('clubb_tend_cam:acc_copyout')
42334244

4234-
call t_startf('clubb_tend_cam:NAR')
4245+
call t_startf('clubb_tend_cam:non_acc_region')
42354246

42364247
! ------------------------------------------------- !
42374248
! Diagnose relative cloud water variance !
@@ -5093,7 +5104,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, &
50935104
enddo
50945105

50955106
endif
5096-
call t_stopf('clubb_tend_cam:NAR')
5107+
call t_stopf('clubb_tend_cam:non_acc_region')
50975108

50985109
! Cleanup err_info
50995110
call cleanup_err_info_api(err_info)

0 commit comments

Comments
 (0)