Skip to content

Commit 2e71569

Browse files
committed
Update 4/29: Update upstream to HEMCO 3.8.1; add performance timers
1 parent b4946bf commit 2e71569

File tree

2 files changed

+42
-17
lines changed

2 files changed

+42
-17
lines changed

Externals_HCO.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[hemco_src]
2-
tag = 3.8.0
2+
tag = 3.8.1
33
protocol = git
44
local_path = HEMCO
55
repo_url = https://github.com/geoschem/hemco.git

hemco_interface.F90

+41-16
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ subroutine HCOI_Chunk_Init()
268268
use cam_logfile, only: iulog
269269
use spmd_utils, only: masterproc, mpicom, masterprocid
270270
use spmd_utils, only: npes, iam
271+
use perf_mod, only: t_startf, t_stopf
271272

272273
use mpi, only: MPI_INTEGER
273274
use ESMF, only: ESMF_VM, ESMF_VMGetCurrent, ESMF_VMGet
@@ -358,11 +359,13 @@ subroutine HCOI_Chunk_Init()
358359

359360
!-----------------------------------------------------------------------
360361

362+
call t_startf('HCOI_Chunk_Init')
363+
361364
if(masterproc) then
362365
write(iulog,*) "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
363366
write(iulog,*) "HEMCO: Harmonized Emissions Component"
364367
write(iulog,*) "https://doi.org/10.5194/gmd-14-5487-2021 (Lin et al., 2021)"
365-
write(iulog,*) "HEMCO_CESM interface version 1.2.2"
368+
write(iulog,*) "HEMCO_CESM interface version 1.3.0"
366369
write(iulog,*) "You are using HEMCO version ", ADJUSTL(HCO_VERSION)
367370
write(iulog,*) "ROOT: ", HcoRoot
368371
write(iulog,*) "Config File: ", HcoConfigFile
@@ -837,6 +840,7 @@ subroutine HCOI_Chunk_Init()
837840
! 4) configuration file initializes ReadList
838841
! 5) universal scale factor for each HEMCO species (Hco_ScaleInit)
839842
!-----------------------------------------------------------------------
843+
call t_startf('HCO_HCOX_Init')
840844
call HCO_Init(HcoState, HMRC)
841845
if(masterproc .and. HMRC /= HCO_SUCCESS) then
842846
write(iulog,*) "******************************************"
@@ -861,6 +865,7 @@ subroutine HCOI_Chunk_Init()
861865
ASSERT_(HMRC==HCO_SUCCESS)
862866

863867
if(masterproc) write(iulog,*) "> HEMCO extensions initialized successfully!"
868+
call t_stopf('HCO_HCOX_Init')
864869

865870
!-----------------------------------------------------------------------
866871
! Additional exports: Verify if additional diagnostic quantities
@@ -1051,6 +1056,8 @@ subroutine HCOI_Chunk_Init()
10511056
write(iulog,*) "> HEMCO additional exports for CESM2-GC initialized!"
10521057
endif
10531058
endif
1059+
1060+
call t_stopf('HCOI_Chunk_Init')
10541061
end subroutine HCOI_Chunk_Init
10551062
!EOC
10561063
!------------------------------------------------------------------------------
@@ -1140,6 +1147,9 @@ subroutine HCOI_Chunk_Run(cam_in, phys_state, pbuf2d, phase)
11401147
use cam_logfile, only: iulog
11411148
use spmd_utils, only: masterproc, mpicom, masterprocid, iam
11421149

1150+
! Performance timers
1151+
use perf_mod, only: t_startf, t_stopf
1152+
11431153
! ESMF
11441154
use ESMF, only: ESMF_GridCompRun
11451155

@@ -1164,6 +1174,8 @@ subroutine HCOI_Chunk_Run(cam_in, phys_state, pbuf2d, phase)
11641174

11651175
logical, save :: FIRST = .true.
11661176

1177+
call t_startf('HCOI_Chunk_Run')
1178+
11671179
if(masterproc) then
11681180
write(iulog,*) "HEMCO_CESM: Running HCOI_Chunk_Run phase", phase
11691181
endif
@@ -1201,20 +1213,26 @@ subroutine HCOI_Chunk_Run(cam_in, phys_state, pbuf2d, phase)
12011213
! hco_pbuf2d => pbuf2d
12021214

12031215
! Set fields from CAM state before run
1216+
call t_startf('HCO_CAM_GetBefore_HCOI')
12041217
call CAM_GetBefore_HCOI(cam_in, phys_state, pbuf2d, phase, &
12051218
HcoState, ExtState)
1219+
call t_stopf('HCO_CAM_GetBefore_HCOI')
12061220

12071221
! Run the gridded component.
1222+
call t_startf('HCO_GridCompRun')
12081223
call ESMF_GridCompRun(HCO_GridComp, rc=RC)!importState=HCO_GridCompState, &
12091224
!exportState=HCO_GridCompState, &
12101225
!rc=RC)
1226+
call t_stopf('HCO_GridCompRun')
12111227

12121228
ASSERT_(RC==ESMF_SUCCESS)
12131229
endif
12141230

12151231
if(masterproc) then
12161232
write(iulog,*) "HEMCO_CESM: Leaving HCOI_Chunk_Run"
12171233
endif
1234+
1235+
call t_stopf('HCOI_Chunk_Run')
12181236
end subroutine HCOI_Chunk_Run
12191237
!EOC
12201238
!------------------------------------------------------------------------------
@@ -1265,27 +1283,30 @@ subroutine HCO_GC_Run(GC, IMPORT, EXPORT, Clock, RC)
12651283
!
12661284
! !USES:
12671285
!
1268-
use cam_logfile, only: iulog
1269-
use spmd_utils, only: masterproc, iam
1286+
use cam_logfile, only: iulog
1287+
use spmd_utils, only: masterproc, iam
1288+
1289+
! Performance timers
1290+
use perf_mod, only: t_startf, t_stopf
12701291

12711292
! HEMCO
1272-
use HCO_Interface_Common, only: GetHcoVal, GetHcoDiagn
1273-
use HCO_Clock_Mod, only: HcoClock_Set, HcoClock_Get
1274-
use HCO_Clock_Mod, only: HcoClock_EmissionsDone
1275-
use HCO_Diagn_Mod, only: HcoDiagn_AutoUpdate
1276-
use HCO_Driver_Mod, only: HCO_Run
1277-
use HCO_EmisList_Mod, only: Hco_GetPtr
1278-
use HCO_Calc_Mod, only: Hco_EvalFld
1279-
use HCO_FluxArr_Mod, only: HCO_FluxArrReset
1280-
use HCO_GeoTools_Mod, only: HCO_CalcVertGrid, HCO_SetPBLm
1281-
1282-
use HCO_State_Mod, only: HCO_GetHcoId
1293+
use HCO_Interface_Common, only: GetHcoVal, GetHcoDiagn
1294+
use HCO_Clock_Mod, only: HcoClock_Set, HcoClock_Get
1295+
use HCO_Clock_Mod, only: HcoClock_EmissionsDone
1296+
use HCO_Diagn_Mod, only: HcoDiagn_AutoUpdate
1297+
use HCO_Driver_Mod, only: HCO_Run
1298+
use HCO_EmisList_Mod, only: Hco_GetPtr
1299+
use HCO_Calc_Mod, only: Hco_EvalFld
1300+
use HCO_FluxArr_Mod, only: HCO_FluxArrReset
1301+
use HCO_GeoTools_Mod, only: HCO_CalcVertGrid, HCO_SetPBLm
1302+
1303+
use HCO_State_Mod, only: HCO_GetHcoId
12831304

12841305
! HEMCO Extensions
1285-
use HCOX_Driver_Mod, only : HCOX_Run
1306+
use HCOX_Driver_Mod, only: HCOX_Run
12861307

12871308
! Physical constants
1288-
use physconst, only : mwdry
1309+
use physconst, only: mwdry
12891310

12901311
! Necessary imported properties for physics calculations
12911312
use hco_cam_convert_state_mod, only: State_HCO_PSFC, State_HCO_TK, State_HCO_PBLH, State_CAM_chmDMS
@@ -1553,6 +1574,8 @@ subroutine HCO_GC_Run(GC, IMPORT, EXPORT, Clock, RC)
15531574
! Run HEMCO!
15541575
!-----------------------------------------------------------------------
15551576

1577+
call t_startf('HCO_HCOX_Run')
1578+
15561579
! Run HCO core module
15571580
! Pass phase as argument. Phase 1 will update the emissions list,
15581581
! phase 2 will calculate the emissions. Emissions will be written into
@@ -1611,6 +1634,8 @@ subroutine HCO_GC_Run(GC, IMPORT, EXPORT, Clock, RC)
16111634

16121635
if(masterproc .and. nCalls < 10) write(iulog,*) "HEMCO_CESM: HCOX_Run"
16131636

1637+
call t_stopf('HCO_HCOX_Run')
1638+
16141639
!-----------------------------------------------------------------------
16151640
! Update "autofill" diagnostics.
16161641
! Update all 'AutoFill' diagnostics. This makes sure that all

0 commit comments

Comments
 (0)