Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update with 'cmeps0.14.2' tag #1

Merged
merged 107 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
5beead0
Update CMEPS (#58)
DeniseWorthen Oct 29, 2021
646ad20
changes to drydep namelist definitions
fvitt Nov 4, 2021
8b117b4
Update CMEPS (#60)
DeniseWorthen Dec 16, 2021
eebde7f
add support for external land component
uturuncoglu Jan 4, 2022
d1e0e08
update exchange fields for nems to include land
uturuncoglu Jan 4, 2022
35fb61b
update exchnage field to work with fully coupled application
uturuncoglu Jan 21, 2022
959c64e
Update CMEPS for wave slow loop coupling and provide hooks for S2SW c…
DeniseWorthen Feb 3, 2022
df272f1
Merge remote-tracking branch 'escomp/master' into feature/fixup_commi…
DeniseWorthen Feb 3, 2022
e204b94
fix for the cases if flds_scalar_index_nextsw_cday is not available
uturuncoglu Feb 16, 2022
9947809
update CMEPS
uturuncoglu Apr 12, 2022
763405c
Update CMEPS; refactor esmFieldsExchange_nems and default_masks (#65)
DeniseWorthen May 2, 2022
c542d8f
first step - reorder pio_init and move to ensemble_driver
jedwards4b May 18, 2022
5df8fd5
standardize subname variable
jedwards4b May 19, 2022
773a48b
Merge remote-tracking branch 'origin/drydep_cmeps0.13.40' into dep_da…
fvitt May 24, 2022
f557497
read dep data from file; preserve seq_drydep_mod interface
fvitt May 25, 2022
a496972
more logging changes
jedwards4b May 27, 2022
b7b2cff
initialize drydep_nflds to zero
fvitt May 31, 2022
424a086
Update CMEPS to its ESCOMP/master branch 20220607 commit (#67)
uturuncoglu Jun 9, 2022
28e3f62
initialize async io logical
jedwards4b Jun 15, 2022
9aa32dc
add more error checking
jedwards4b Jun 15, 2022
ae2c368
merge to current master
jedwards4b Jun 15, 2022
89155de
update
uturuncoglu Jun 21, 2022
e1736b6
sync with master
uturuncoglu Jun 21, 2022
3516bbd
fix after merge with master
uturuncoglu Jun 21, 2022
94c5e8d
add bilnr_nstod mapping between ocn/ice/waves (#68)
DeniseWorthen Jun 22, 2022
e2d0bba
async io test passes ERS_Ln9.ne30pg3_ne30pg3_mg17.QPC6.cheyenne_intel…
jedwards4b Jun 23, 2022
694ac85
fix for land coupling
uturuncoglu Jun 23, 2022
c569aa6
clean print statement
uturuncoglu Jun 23, 2022
80408b4
add some comments
jedwards4b Jun 23, 2022
f3e0844
fix if block
jedwards4b Jun 24, 2022
67ae99b
more log info
jedwards4b Jul 5, 2022
639adab
cleanup and comment
jedwards4b Jul 6, 2022
1ec59d0
add to use statement
jedwards4b Jul 6, 2022
f56af79
state as of now
jedwards4b Jul 13, 2022
fdf5009
save for vacation
jedwards4b Jul 13, 2022
5f646a0
set wavice_coupling to false for now because it causes instabilities.…
alperaltuntas Jul 19, 2022
5e8d703
Merge pull request #303 from fvitt/dep_data_file
jedwards4b Jul 26, 2022
f9f7541
Add field exchanges required by wave-ice coupling (#69)
DeniseWorthen Jul 27, 2022
8088dd2
more debugged
jedwards4b Aug 8, 2022
c019982
more asyncio debugging;
jedwards4b Aug 9, 2022
c7b75d1
fix masking issue for land coupling
uturuncoglu Aug 11, 2022
8ba09a6
fix surface pressure issue for land coupling
uturuncoglu Aug 18, 2022
5e9c7d9
Update cime config namelist definition to include datmcomf/drv_flds_i…
adrifoster Aug 31, 2022
5559270
add namelist control of async rearranger
jedwards4b Sep 12, 2022
c91b15c
mods for land side-by-side configuration
uturuncoglu Sep 15, 2022
c550a3f
merge to latest master
jedwards4b Sep 21, 2022
cdbd5c1
merge to master
jedwards4b Sep 21, 2022
ce1bb64
put in correct way to set namelist for wavice coupling (#312)
mvertens Oct 6, 2022
325c107
changes that permits DAE test to work (#314)
mvertens Oct 7, 2022
962e753
simplify specification of stop_option, rest_option and history_option…
mvertens Oct 7, 2022
5157de0
Merge pull request #305 from jedwards4b/jedwards/asyncio
jedwards4b Oct 7, 2022
98e814f
Revert "first step - reorder pio_init and move to ensemble_driver"
jedwards4b Oct 12, 2022
6245807
Merge pull request #315 from ESCOMP/revert-305-jedwards/asyncio
jedwards4b Oct 12, 2022
978e0f2
was not working when atm and lnd did not share all tasks
jedwards4b Oct 12, 2022
6ee26a2
Merge pull request #310 from uturuncoglu/feature/lnd_noahmp
uturuncoglu Oct 12, 2022
1ba5eb4
fix a bug introduced in PR 313
jedwards4b Oct 13, 2022
ff8726f
Merge pull request #316 from jedwards4b/fix_drydep_initialize
jedwards4b Oct 13, 2022
5081a8e
fixes to instantaneous output
Oct 14, 2022
f3f34b0
fixes to time variable for instantaneous auxhist output
Oct 14, 2022
7b96332
fixed aux files 1-5 for atm
Oct 16, 2022
0e3bb2d
Merge branch 'master' into feature/fix_auxhist
Oct 16, 2022
aabe844
Update CMEPS to latest ESCOMP/master (#72)
DeniseWorthen Oct 28, 2022
76306f6
remove debug and obsolete statements
jedwards4b Nov 2, 2022
fa2ac92
Merge pull request #317 from mvertens/feature/fix_auxhist
jedwards4b Nov 2, 2022
56d71e4
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Nov 8, 2022
8763c77
fix unresolved merge conflict
DeniseWorthen Nov 8, 2022
01deceb
update CMEPS (#75)
DeniseWorthen Nov 16, 2022
02582eb
needed for using ESMF_AWARE_THREADING=TRUE
jedwards4b Nov 16, 2022
0cf254c
code clean up suggested in review
jedwards4b Nov 17, 2022
ce1305c
Merge pull request #319 from jedwards4b/esmf_aware_threading_fix
jedwards4b Nov 17, 2022
ef76dd1
make fldList a singly linked list
jedwards4b Nov 19, 2022
cc86157
one the way to fully functional linked list implementation
jedwards4b Nov 19, 2022
fbb8ef5
save work
jedwards4b Nov 19, 2022
69f31b8
compiles now
jedwards4b Nov 20, 2022
9d01b7b
save warnings in log
jedwards4b Nov 20, 2022
2dc1597
debugging
jedwards4b Nov 20, 2022
d494fa5
now passing SMS_Ld3.f19_g17_rx1.A.cheyenne_intel
jedwards4b Nov 21, 2022
13020c7
some cleanup
jedwards4b Nov 21, 2022
662e171
more clean-up
jedwards4b Nov 21, 2022
40ba09b
more list translation
jedwards4b Nov 21, 2022
75650c9
more loop structure changes
jedwards4b Nov 22, 2022
5c653fc
fix a pointer bug
jedwards4b Nov 23, 2022
24aff18
fix findname
jedwards4b Nov 23, 2022
70877f7
Merge remote-tracking branch 'origin/emc/develop' into feature/updcmeps
DeniseWorthen Nov 27, 2022
220a011
Merge remote-tracking branch 'remotes/escomp/master' into feature/upd…
DeniseWorthen Nov 27, 2022
7c76290
Merge remote-tracking branch 'JEdwards/LL_fldList' into feature/updcmeps
DeniseWorthen Nov 27, 2022
c6a597f
fix wave elevation spectrum for UFS
DeniseWorthen Nov 27, 2022
c33b88a
add a bit more debug info
jedwards4b Nov 28, 2022
d9f141b
add a bit more debug info
jedwards4b Nov 28, 2022
b4c68eb
a fix to get the num field count correct
jedwards4b Nov 28, 2022
736bce6
Merge remote-tracking branch 'ESCOMP/LL_fldList' into feature/updcmeps
DeniseWorthen Nov 28, 2022
628b134
add protection
jedwards4b Nov 28, 2022
b5d91b8
Merge remote-tracking branch 'ESCOMP/LL_fldList' into feature/updcmeps
DeniseWorthen Nov 28, 2022
eb78801
response to git review
jedwards4b Nov 29, 2022
15e746b
fix typos
jedwards4b Nov 29, 2022
841258a
more name changes
jedwards4b Nov 29, 2022
b8c29e6
add an abort call
jedwards4b Nov 30, 2022
ae5cfcd
Merge pull request #322 from jedwards4b/LL_fldList
jedwards4b Nov 30, 2022
4abc4b3
Merge remote-tracking branch 'escomp/master' into feature/updcmeps
DeniseWorthen Dec 1, 2022
57b6c0e
fix compile error
DeniseWorthen Dec 1, 2022
4198c59
move shr_file_getLogUnit to shr_log_getLogUnit
jedwards4b Dec 1, 2022
28199a1
fix mapping for ocn-wav
DeniseWorthen Dec 1, 2022
91749fd
Merge pull request #324 from DeniseWorthen/feature/updcmeps
jedwards4b Dec 5, 2022
28f335d
undo change to xgrid
jedwards4b Dec 5, 2022
a268235
Merge pull request #323 from jedwards4b/shr_file_to_shr_log
jedwards4b Dec 5, 2022
6c56358
Compatability patch before merging 'cmeps0.14.2' for esmFldsExchange_…
gdicker1 Apr 28, 2023
5da160c
Merge tag 'cmeps0.14.2' from ESCOMP/CMEPS into 'ew-develop'
gdicker1 Apr 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cesm/driver/ensemble_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module Ensemble_driver
!-----------------------------------------------------------------------------

use shr_kind_mod , only : cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_log_mod , only : shrlogunit=> shr_log_unit
use shr_file_mod , only : shr_file_setLogUnit
use shr_log_mod , only : shr_log_setLogUnit
use esm_utils_mod , only : mastertask, logunit, chkerr

implicit none
Expand Down Expand Up @@ -256,10 +255,10 @@ subroutine SetModelServices(ensemble_driver, rc)
open (newunit=logunit,file=trim(diro)//"/"//trim(logfile))
mastertask = .true.
else
logUnit = shrlogunit
logUnit = 6
mastertask = .false.
endif
call shr_file_setLogUnit (logunit)
call shr_log_setLogUnit (logunit)

! Create a clock for each driver instance
call esm_time_clockInit(ensemble_driver, driver, logunit, mastertask, rc)
Expand Down
6 changes: 2 additions & 4 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module ESM
use shr_sys_mod , only : shr_sys_abort
use shr_mpi_mod , only : shr_mpi_bcast
use shr_mem_mod , only : shr_mem_init
use shr_file_mod , only : shr_file_setLogunit
use shr_log_mod , only : shr_log_setLogunit
use esm_utils_mod, only : logunit, mastertask, dbug_flag, chkerr
use perf_mod , only : t_initf, t_setLogUnit

Expand Down Expand Up @@ -141,10 +141,8 @@ subroutine SetModelServices(driver, rc)

!-------------------------------------------
! Set the io logunit to the value defined in ensemble_driver
! TODO: - is this statement still correct?
! it may be corrected below if the med mastertask is not the driver mastertask
!-------------------------------------------
call shr_file_setLogunit(logunit)
call shr_log_setLogunit(logunit)

!-------------------------------------------
! Get the config and vm objects from the driver
Expand Down
55 changes: 28 additions & 27 deletions cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ module esm_time_mod

! Clock and alarm options
character(len=*), private, parameter :: &
optNONE = "none" , &
optNever = "never" , &
optNSteps = "nsteps" , &
optNSeconds = "nseconds" , &
optNMinutes = "nminutes" , &
optNHours = "nhours" , &
optNDays = "ndays" , &
optNMonths = "nmonths" , &
optNYears = "nyears" , &
optMonthly = "monthly" , &
optYearly = "yearly" , &
optDate = "date" , &
optNONE = "none" , &
optNever = "never" , &
optNSteps = "nstep" , &
optNSeconds = "nsecond" , &
optNMinutes = "nminute" , &
optNHours = "nhour" , &
optNDays = "nday" , &
optNMonths = "nmonth" , &
optNYears = "nyear" , &
optMonthly = "monthly" , &
optYearly = "yearly" , &
optDate = "date" , &
optGLCCouplingPeriod = "glc_coupling_period"

! Module data
Expand Down Expand Up @@ -434,13 +434,14 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
rc = ESMF_FAILURE
return
end if
else if (trim(option) == optNSteps .or. &
trim(option) == optNSeconds .or. &
trim(option) == optNMinutes .or. &
trim(option) == optNHours .or. &
trim(option) == optNDays .or. &
trim(option) == optNMonths .or. &
trim(option) == optNYears) then
else if (&
trim(option) == optNSteps .or. trim(option) == trim(optNSteps)//'s' .or. &
trim(option) == optNSeconds .or. trim(option) == trim(optNSeconds)//'s' .or. &
trim(option) == optNMinutes .or. trim(option) == trim(optNMinutes)//'s' .or. &
trim(option) == optNHours .or. trim(option) == trim(optNHours)//'s' .or. &
trim(option) == optNDays .or. trim(option) == trim(optNDays)//'s' .or. &
trim(option) == optNMonths .or. trim(option) == trim(optNMonths)//'s' .or. &
trim(option) == optNYears .or. trim(option) == trim(optNYears)//'s' ) then
if (.not.present(opt_n)) then
call ESMF_LogWrite(subname//trim(option)//' requires opt_n', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
Expand All @@ -451,7 +452,7 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
rc = ESMF_FAILURE
return
end if
end if
end if

! Determine inputs for call to create alarm
selectcase (trim(option))
Expand Down Expand Up @@ -479,36 +480,36 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
if (ChkErr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .false.

case (optNSteps)
case (optNSteps,trim(optNSteps)//'s')
call ESMF_ClockGet(clock, TimeStep=AlarmInterval, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNSeconds)
case (optNSeconds,trim(optNSeconds)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, s=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNMinutes)
case (optNMinutes,trim(optNMinutes)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, s=60, rc=rc)
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNHours)
case (optNHours,trim(optNHours)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, s=3600, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNDays)
case (optNDays,trim(optNDays)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, d=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNMonths)
case (optNMonths,trim(optNMonths)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
Expand All @@ -521,7 +522,7 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
if (ChkErr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .true.

case (optNYears)
case (optNYears, trim(optNYears)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, yy=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
Expand Down
5 changes: 3 additions & 2 deletions cesm/driver/util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ module util
! CustomFieldDictionaryProto utility module
!-----------------------------------------------------------------------------

use ESMF
use NUOPC
use ESMF, only : ESMF_SUCCESS, ESMF_MAXSTR, ESMF_IOFmt_flag, ESMF_LogWrite
use ESMF, only : ESMF_LOGMSG_INFO, ESMF_LOGERR_PASSTHRU, ESMF_LOGFoundError
use NUOPC, only : nuopc_freeFormat, nuopc_freeformatLog, nuopc_fieldDictionaryEgest

implicit none

Expand Down
136 changes: 69 additions & 67 deletions cesm/nuopc_cap_share/driver_pio_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module driver_pio_mod
use pio
use shr_pio_mod, only : io_compname, pio_comp_settings, iosystems, io_compid, shr_pio_getindex
use shr_kind_mod, only : CS=>shr_kind_CS, shr_kind_cl, shr_kind_in
use shr_file_mod, only : shr_file_getunit, shr_file_freeunit
use shr_log_mod, only : shr_log_unit
use shr_mpi_mod, only : shr_mpi_bcast, shr_mpi_chkerr
use shr_sys_mod, only : shr_sys_abort
Expand Down Expand Up @@ -212,86 +211,89 @@ subroutine driver_pio_component_init(driver, ncomps, rc)
if (ESMF_GridCompIsPetLocal(gcomp(i), rc=rc)) then
call ESMF_GridCompGet(gcomp(i), vm=vm, name=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

io_compname(i) = trim(cval)

call NUOPC_CompAttributeAdd(gcomp(i), attrList=(/'MCTID'/), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

write(cval, *) io_compid(i)
call NUOPC_CompAttributeSet(gcomp(i), name="MCTID", value=trim(cval), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call ESMF_VMGet(vm, mpiCommunicator=comp_comm, localPet=comp_rank, petCount=npets, &
ssiLocalPetCount=default_stride, rc=rc)
call ESMF_VMGet(vm, mpiCommunicator=comp_comm, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call NUOPC_CompAttributeGet(gcomp(i), name="pio_stride", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_stride
if(pio_comp_settings(i)%pio_stride <= 0 .or. pio_comp_settings(i)%pio_stride > npets) then
pio_comp_settings(i)%pio_stride = min(npets, default_stride)
endif

call NUOPC_CompAttributeGet(gcomp(i), name="pio_rearranger", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_rearranger

call NUOPC_CompAttributeGet(gcomp(i), name="pio_numiotasks", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_numiotasks

if(pio_comp_settings(i)%pio_numiotasks < 0 .or. pio_comp_settings(i)%pio_numiotasks > npets) then
pio_comp_settings(i)%pio_numiotasks = max(1,npets/pio_comp_settings(i)%pio_stride)
endif


call NUOPC_CompAttributeGet(gcomp(i), name="pio_root", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_root

if(pio_comp_settings(i)%pio_root < 0 .or. pio_comp_settings(i)%pio_root > npets) then
pio_comp_settings(i)%pio_root = 0
endif

if(comp_comm .ne. MPI_COMM_NULL) then
call ESMF_VMGet(vm, petCount=npets, localPet=comp_rank, ssiLocalPetCount=default_stride, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call NUOPC_CompAttributeGet(gcomp(i), name="pio_typename", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

select case (trim(cval))
case ('pnetcdf')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_PNETCDF
case ('netcdf')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_NETCDF
case ('netcdf4p')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_NETCDF4P
case ('netcdf4c')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_NETCDF4C
case DEFAULT
write (msgstr, *) "Invalid PIO_TYPENAME Setting for component ", trim(cval)
call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
return
end select
call NUOPC_CompAttributeGet(gcomp(i), name="pio_stride", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_stride
if(pio_comp_settings(i)%pio_stride <= 0 .or. pio_comp_settings(i)%pio_stride > npets) then
pio_comp_settings(i)%pio_stride = min(npets, default_stride)
endif

call NUOPC_CompAttributeGet(gcomp(i), name="pio_async_interface", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
pio_async_interface(i) = (trim(cval) == '.true.')

call NUOPC_CompAttributeGet(gcomp(i), name="pio_netcdf_format", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call driver_pio_getioformatfromname(cval, pio_comp_settings(i)%pio_netcdf_ioformat, PIO_64BIT_DATA)
call NUOPC_CompAttributeGet(gcomp(i), name="pio_rearranger", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_rearranger
call NUOPC_CompAttributeGet(gcomp(i), name="pio_numiotasks", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_numiotasks

if (pio_async_interface(i)) then
do_async_init = do_async_init + 1
else
if(pio_rearr_opts%comm_fc_opts_io2comp%max_pend_req < PIO_REARR_COMM_UNLIMITED_PEND_REQ) then
pio_rearr_opts%comm_fc_opts_io2comp%max_pend_req = pio_comp_settings(i)%pio_numiotasks
if(pio_comp_settings(i)%pio_numiotasks < 0 .or. pio_comp_settings(i)%pio_numiotasks > npets) then
pio_comp_settings(i)%pio_numiotasks = max(1,npets/pio_comp_settings(i)%pio_stride)
endif
if(pio_rearr_opts%comm_fc_opts_comp2io%max_pend_req < PIO_REARR_COMM_UNLIMITED_PEND_REQ) then
pio_rearr_opts%comm_fc_opts_comp2io%max_pend_req = pio_comp_settings(i)%pio_numiotasks

call NUOPC_CompAttributeGet(gcomp(i), name="pio_root", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
read(cval, *) pio_comp_settings(i)%pio_root

if(pio_comp_settings(i)%pio_root < 0 .or. pio_comp_settings(i)%pio_root > npets) then
pio_comp_settings(i)%pio_root = 0
endif

call NUOPC_CompAttributeGet(gcomp(i), name="pio_typename", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

select case (trim(cval))
case ('pnetcdf')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_PNETCDF
case ('netcdf')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_NETCDF
case ('netcdf4p')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_NETCDF4P
case ('netcdf4c')
pio_comp_settings(i)%pio_iotype = PIO_IOTYPE_NETCDF4C
case DEFAULT
write (msgstr, *) "Invalid PIO_TYPENAME Setting for component ", trim(cval)
call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
return
end select

call NUOPC_CompAttributeGet(gcomp(i), name="pio_async_interface", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
pio_async_interface(i) = (trim(cval) == '.true.')

call NUOPC_CompAttributeGet(gcomp(i), name="pio_netcdf_format", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call driver_pio_getioformatfromname(cval, pio_comp_settings(i)%pio_netcdf_ioformat, PIO_64BIT_DATA)

if (pio_async_interface(i)) then
do_async_init = do_async_init + 1
else
if(pio_rearr_opts%comm_fc_opts_io2comp%max_pend_req < PIO_REARR_COMM_UNLIMITED_PEND_REQ) then
pio_rearr_opts%comm_fc_opts_io2comp%max_pend_req = pio_comp_settings(i)%pio_numiotasks
endif
if(pio_rearr_opts%comm_fc_opts_comp2io%max_pend_req < PIO_REARR_COMM_UNLIMITED_PEND_REQ) then
pio_rearr_opts%comm_fc_opts_comp2io%max_pend_req = pio_comp_settings(i)%pio_numiotasks
endif
call pio_init(comp_rank ,comp_comm ,pio_comp_settings(i)%pio_numiotasks, 0, pio_comp_settings(i)%pio_stride, &
pio_comp_settings(i)%pio_rearranger, iosystems(i), pio_comp_settings(i)%pio_root, &
pio_rearr_opts)
endif
call pio_init(comp_rank ,comp_comm ,pio_comp_settings(i)%pio_numiotasks, 0, pio_comp_settings(i)%pio_stride, &
pio_comp_settings(i)%pio_rearranger, iosystems(i), pio_comp_settings(i)%pio_root, &
pio_rearr_opts)
endif
endif
enddo
Expand Down
9 changes: 4 additions & 5 deletions cesm/nuopc_cap_share/nuopc_shr_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module nuopc_shr_methods
use NUOPC_Model , only : NUOPC_ModelGet
use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_sys_mod , only : shr_sys_abort
use shr_file_mod , only : shr_file_setlogunit, shr_file_getLogUnit
use shr_log_mod , only : shr_log_setLogUnit

implicit none
private
Expand Down Expand Up @@ -149,8 +149,6 @@ subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)

rc = ESMF_SUCCESS

shrlogunit = 6

if (mastertask) then
call NUOPC_CompAttributeGet(gcomp, name="diro", value=diro, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
Expand All @@ -170,8 +168,9 @@ subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)
else
logUnit = 6
endif
! TODO: shr_file mod is deprecated and should be removed.
call shr_file_setLogUnit (logunit)
shrlogunit = logunit

call shr_log_setLogUnit (logunit)

end subroutine set_component_logging

Expand Down
Loading