Skip to content

Commit 045c1a7

Browse files
committed
Merge pull request #325 from jedwards4b/pio_asyncio_in_cmeps
enable asyncio using pio ### Description of changes Allows IO tasks to be independent of compute tasks in cesm ### Specific notes (testing in progress) Contributors other than yourself, if any: Depends on share (ESCOMP#37) and cime (ESMCI/cime#4340). CMEPS Issues Fixed (include github issue #): Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial) Any User Interface Changes (namelist or namelist defaults changes)? ### Testing performed Testing performed if application target is CESM: - [ ] (recommended) CIME_DRIVER=nuopc scripts_regression_tests.py - machines: - details (e.g. failed tests): - [ ] (recommended) CESM testlist_drv.xml - machines and compilers: - details (e.g. failed tests): - [X] (optional) CESM prealpha test - machines and compilers cheyenne intel - details (e.g. failed tests): results consistant with cesm2_3_alpha10d - [ ] (other) please described in detail - machines and compilers - details (e.g. failed tests): Testing performed if application target is UFS-coupled: - [ ] (recommended) UFS-coupled testing - description: - details (e.g. failed tests): Testing performed if application target is UFS-HAFS: - [X] (recommended) UFS-HAFS testing - description: - details (e.g. failed tests): ### Hashes used for testing: - [ ] CESM: - repository to check out: https://github.com/ESCOMP/CESM.git - branch/hash: - [ ] UFS-coupled, then umbrella repostiory to check out and associated hash: - repository to check out: - branch/hash: - [ ] UFS-HAFS, then umbrella repostiory to check out and associated hash: - repository to check out: - branch/hash:
1 parent 7d09252 commit 045c1a7

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/nuopc_shr_methods.F90

+15-7
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ subroutine get_component_instance(gcomp, inst_suffix, inst_index, rc)
130130
end subroutine get_component_instance
131131

132132
!===============================================================================
133-
134133
subroutine set_component_logging(gcomp, maintask, logunit, shrlogunit, rc)
135-
use driver_pio_mod, only : driver_pio_log_comp_settings
134+
use NUOPC, only: NUOPC_CompAttributeSet, NUOPC_CompAttributeAdd
136135
! input/output variables
137136
type(ESMF_GridComp) :: gcomp
138137
logical, intent(in) :: maintask
@@ -144,8 +143,10 @@ subroutine set_component_logging(gcomp, maintask, logunit, shrlogunit, rc)
144143
character(len=CL) :: diro
145144
character(len=CL) :: logfile
146145
character(len=CL) :: inst_suffix
147-
integer :: inst_index ! not used here
146+
integer :: inst_index ! Not used here
148147
integer :: n
148+
character(len=CL) :: name
149+
character(len=*), parameter :: subname = "("//__FILE__//": set_component_logging)"
149150
!-----------------------------------------------------------------------
150151

151152
rc = ESMF_SUCCESS
@@ -164,16 +165,23 @@ subroutine set_component_logging(gcomp, maintask, logunit, shrlogunit, rc)
164165
endif
165166

166167
open(newunit=logunit,file=trim(diro)//"/"//trim(logfile))
167-
! Write the PIO settings to the beggining of each component log
168-
call driver_pio_log_comp_settings(gcomp, logunit)
169168

170169
else
171170
logUnit = 6
172171
endif
173-
shrlogunit = logunit
172+
173+
call ESMF_GridCompGet(gcomp, name=name, rc=rc)
174+
if (chkerr(rc,__LINE__,u_FILE_u)) return
174175

176+
call ESMF_LogWrite(trim(subname)//": setting logunit for component: "//trim(name), ESMF_LOGMSG_INFO)
177+
call NUOPC_CompAttributeAdd(gcomp, (/"logunit"/), rc=rc)
178+
if (chkerr(rc,__LINE__,u_FILE_u)) return
179+
call NUOPC_CompAttributeSet(gcomp, "logunit", logunit, rc=rc)
180+
if (chkerr(rc,__LINE__,u_FILE_u)) return
175181
call shr_log_setLogUnit (logunit)
176-
182+
! Still need to set this return value
183+
shrlogunit = logunit
184+
call ESMF_LogWrite(trim(subname)//": done for component "//trim(name), ESMF_LOGMSG_INFO)
177185
end subroutine set_component_logging
178186

179187
!===============================================================================

0 commit comments

Comments
 (0)