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

Add logging features to nuopc/cmeps cap; deprecates zsalinity in cap #856

Merged
merged 168 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
0338d04
Merge pull request #1 from CICE-Consortium/master
DeniseWorthen Feb 25, 2020
99470ed
Merge pull request #2 from CICE-Consortium/master
DeniseWorthen Mar 7, 2020
71d2ded
Merge pull request #3 from CICE-Consortium/master
DeniseWorthen Apr 2, 2020
d46d691
merge latest master (#4)
DeniseWorthen Apr 22, 2020
183218a
updated orbital calculations needed for cesm
Apr 23, 2020
10e7c20
fixed problems in updated orbital calculations needed for cesm
Apr 29, 2020
ce8e5a9
update CICE6 to support coupling with UFS
apcraig May 10, 2020
8f0b5ee
Merge pull request #2 from apcraig/ufs01
dabail10 May 10, 2020
7ac0e3d
Merge pull request #1 from ESCOMP/nuopc
DeniseWorthen May 12, 2020
80c9e6e
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 May 19, 2020
53715ea
put in changes so that both ufsatm and cesm requirements for potentia…
May 25, 2020
7e43703
Merge pull request #3 from mvertens/mvertens/nuopc
dabail10 May 26, 2020
397e588
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jun 2, 2020
3bb3694
Convergence on ustar for CICE. (#452) (#5)
DeniseWorthen Jun 5, 2020
f41f1e9
Merge remote-tracking branch 'upstream/nuopc' into HEAD
DeniseWorthen Jun 22, 2020
e70d1ab
update icepack submodule
DeniseWorthen Jun 22, 2020
308a1d4
Revert "update icepack submodule"
DeniseWorthen Jun 22, 2020
7848fdf
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jun 24, 2020
6982ee4
Merge remote-tracking branch 'upstream/nuopc' into HEAD
DeniseWorthen Jun 25, 2020
089f60f
update comp_ice.backend with temporary ice_timers fix
DeniseWorthen Jun 25, 2020
6affdcf
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jun 29, 2020
b5a6058
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 1, 2020
415df0e
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 1, 2020
b4da8a6
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 1, 2020
239c7de
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 1, 2020
ad03424
Fix threading problem in init_bgc
dabail10 Jul 1, 2020
73e7774
Fix additional OMP problems
dabail10 Jul 1, 2020
46fcfba
changes for coldstart running
DeniseWorthen Jul 2, 2020
c762336
Move the forapps directory
dabail10 Jul 2, 2020
6bccf71
remove cesmcoupled ifdefs
DeniseWorthen Jul 2, 2020
902e883
Fix logging issues for NUOPC
dabail10 Jul 2, 2020
178693a
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 2, 2020
b4afd2e
removal of many cpp-ifdefs
Jul 4, 2020
3a1b88b
fix compile errors
DeniseWorthen Jul 4, 2020
41855fd
fixes to get cesm working
Jul 4, 2020
aea1aa8
update to latest nuopc changes
Jul 4, 2020
e4c989c
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 6, 2020
30a81cc
fixed white space issue
Jul 7, 2020
8ebdda9
Merge pull request #4 from mvertens/nuopc
dabail10 Jul 7, 2020
27dd3b7
Add restart_coszen namelist option
dabail10 Jul 7, 2020
50bf856
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jul 7, 2020
6b4a277
Merge branch 'nuopc' into coszen
dabail10 Jul 7, 2020
93f0e86
Merge pull request #5 from ESCOMP/coszen
dabail10 Jul 7, 2020
f92bef3
update icepack submodule
DeniseWorthen Jul 7, 2020
4e8cc79
Merge remote-tracking branch 'upstream/nuopc' into emc/develop
DeniseWorthen Jul 7, 2020
8ff4ee0
change Orion to orion in backend
DeniseWorthen Jul 7, 2020
916c6af
add -link_mpi=dbg to debug flags (#8)
DeniseWorthen Jul 14, 2020
9bdb9ad
Merge remote-tracking branch 'CICE-Consortium/master' into emc/develop
DeniseWorthen Jul 15, 2020
8f37bfc
cice6 compile (#6)
MinsukJi-NOAA Jul 17, 2020
86b8dab
Merge remote-tracking branch 'upstream/emc/develop' into HEAD
DeniseWorthen Jul 17, 2020
c084de4
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Jul 17, 2020
88cc2fd
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Aug 5, 2020
bdf1a1f
changes for consistency w/ current emc-cice5 (#13)
DeniseWorthen Aug 12, 2020
5ecde75
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 12, 2020
d81a834
Fixcommit (#14)
DeniseWorthen Aug 13, 2020
4d7ba5b
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Aug 13, 2020
5dcfca8
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 13, 2020
285985c
Update CICE6 for integration to S2S
DeniseWorthen Aug 31, 2020
6d30789
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 31, 2020
8129aab
Merge remote-tracking branch 'consortium/master' into emc/develop
DeniseWorthen Aug 31, 2020
ac617cd
Support TACC stampede (#19)
MinsukJi-NOAA Oct 8, 2020
23cdee7
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Oct 8, 2020
1e4f42b
update icepack
DeniseWorthen Oct 30, 2020
2515f77
Merge remote-tracking branch 'consortium/master' into feature/updcice
DeniseWorthen Oct 30, 2020
41afe74
add ice_dyn_vp module to CICE_InitMod
DeniseWorthen Oct 30, 2020
2a0f332
update gitmodules, update icepack
DeniseWorthen Nov 10, 2020
f773ef3
Update CICE to consortium master (#23)
DeniseWorthen Nov 10, 2020
840e931
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Nov 10, 2020
1e4d393
Merge remote-tracking branch 'upstream/emc/develop' into feature/updcice
DeniseWorthen Mar 14, 2021
66546ae
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Mar 14, 2021
2eca569
update icepack
DeniseWorthen Apr 5, 2021
b52e91c
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Apr 5, 2021
51db2f9
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jun 1, 2021
d8fb6d9
switch icepack branches
DeniseWorthen Jun 2, 2021
9a76541
update icepack
DeniseWorthen Jun 4, 2021
519d339
Update CICE to latest Consortium master (#26)
DeniseWorthen Jun 4, 2021
74e7b58
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Jun 5, 2021
9d88d92
add cice changes for zlvs (#29)
DeniseWorthen Jun 10, 2021
d1f2d15
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Jun 11, 2021
0c39047
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Jun 24, 2021
f3b2652
update icepack and pointer
DeniseWorthen Jun 24, 2021
9057817
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jun 24, 2021
1721728
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jul 2, 2021
55586f7
update icepack and revert gitmodules
DeniseWorthen Jul 20, 2021
441f693
Fix history features
apcraig Aug 10, 2021
15763d8
revert set_nml.histall
apcraig Aug 10, 2021
b3364a6
fix implementation error
apcraig Aug 11, 2021
96d5851
update model log output in ice_init
apcraig Aug 11, 2021
7b5c2b4
Fix QC issues
apcraig Aug 12, 2021
c5794b4
Update testing
apcraig Aug 13, 2021
eaa3c3a
update documentation
apcraig Aug 13, 2021
e31ce7e
reset calchk to 100000 years
apcraig Aug 13, 2021
83068c7
update evp1d test
apcraig Aug 13, 2021
3fd897e
Merge branch 'master' of https://github.com/cice-consortium/cice into…
apcraig Aug 13, 2021
4373d3d
update icepack
DeniseWorthen Aug 15, 2021
71f4fe6
Merge remote-tracking branch 'TCraig/tmB' into feature/updcice
DeniseWorthen Aug 15, 2021
aeb473a
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Aug 20, 2021
aade124
update icepack
DeniseWorthen Aug 20, 2021
7f089d0
add memory profiling (#36)
DeniseWorthen Aug 23, 2021
397b4bd
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Aug 26, 2021
a1b3375
update icepack
DeniseWorthen Aug 31, 2021
7d2139c
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Aug 31, 2021
cd021b5
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Sep 1, 2021
5cb78cd
fix rhoa when lowest_temp is 0.0
DeniseWorthen Sep 15, 2021
d0a45a2
update icepack submodule
DeniseWorthen Sep 16, 2021
2540695
Update CICE for latest Consortium master (#38)
DeniseWorthen Sep 16, 2021
8a88024
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Sep 20, 2021
d95bd51
Use CICE-Consortium/Icepack master (#40)
DeniseWorthen Oct 1, 2021
d83c67b
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Oct 12, 2021
8d4a3c6
recreate cap update branch (#42)
DeniseWorthen Nov 22, 2021
55bf9f4
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Nov 29, 2021
7a0b65e
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Nov 30, 2021
abbebab
remove 2 extraneous lines
DeniseWorthen Nov 30, 2021
8ff0fb2
duplicate gitmodule style for icepack
DeniseWorthen Nov 30, 2021
27dfd1b
Update CICE to latest Consortium/main (#45)
DeniseWorthen Feb 24, 2022
c660075
Update CICE to Consortium/main (#48)
DeniseWorthen May 10, 2022
4b28dfe
Merge remote-tracking branch 'Consortium/main' into feature/addCgrid
DeniseWorthen May 14, 2022
247dc1d
fix comment, fix env for orion and hera
DeniseWorthen May 14, 2022
dd158e2
replace save_init with step_prep in CICE_RunMod
DeniseWorthen May 14, 2022
ae50efe
fixes for cgrid repro
DeniseWorthen May 22, 2022
cbc6046
remove added haloupdates
DeniseWorthen May 24, 2022
ab95d2d
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 2, 2022
a38df37
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 13, 2022
2d5487a
change F->S for ocean velocities and tilts
DeniseWorthen Jun 13, 2022
26498db
fix debug failure when grid_ice=C
DeniseWorthen Jun 20, 2022
9e2dd69
respond to review comments
DeniseWorthen Jun 22, 2022
cc0f89c
remove inserted whitespace for uvelE,N and vvelE,N
DeniseWorthen Jun 22, 2022
73cc18c
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 23, 2022
1f70caf
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Aug 20, 2022
968a0ed
Add wave-cice coupling; update to Consortium main (#51)
DeniseWorthen Aug 30, 2022
d6d081a
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Nov 2, 2022
2e68b9e
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Nov 2, 2022
b893ee9
add initializationsin ice_state
DeniseWorthen Nov 2, 2022
b11bfb4
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Nov 8, 2022
fe16051
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Nov 16, 2022
7757945
Update CICE (#54)
DeniseWorthen Nov 25, 2022
90a8b62
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Dec 6, 2022
ad8d577
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Dec 6, 2022
ce2298e
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Jan 4, 2023
ed472ab
fix for nudiag_set
DeniseWorthen Jan 9, 2023
506614d
Merge remote-tracking branch 'CICE-Consortium/main' into test
DeniseWorthen Jan 14, 2023
dd25b0f
Merge branch 'test' into feature/updcice
DeniseWorthen Jan 14, 2023
e628a9a
Update CICE for latest Consortium/main (#56)
DeniseWorthen Jan 23, 2023
ee68d3f
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Mar 7, 2023
6671e32
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Mar 7, 2023
5840cd1
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Mar 22, 2023
bd0ee2c
add run time info
junwang-noaa Jun 27, 2023
e01660b
change real(8) to real(dbl)kind)
junwang-noaa Jul 6, 2023
b475ad4
fix syntax
junwang-noaa Jul 6, 2023
dc73c66
fix write unit
junwang-noaa Jul 6, 2023
1e65452
use cice_wrapper for ufs timer functionality
DeniseWorthen Jul 6, 2023
c6049c5
add elapsed model time for logtime
DeniseWorthen Jul 6, 2023
b7d88d9
tidy up the wrapper
DeniseWorthen Jul 7, 2023
fead17f
add timer and forecast log
DeniseWorthen Jul 7, 2023
a744734
only one time is needed
DeniseWorthen Jul 8, 2023
1c98b43
modify message written for log.ice.fXXX
DeniseWorthen Jul 10, 2023
dd13d6f
change info in fXXX log file
DeniseWorthen Jul 10, 2023
1870b3a
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Jul 24, 2023
8baa3eb
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Jul 25, 2023
d41c61d
Update CICE from Consortium/main (#62)
DeniseWorthen Aug 2, 2023
7c0a18e
Merge branch 'NOAA-EMC:emc/develop' into feature/runtime
DeniseWorthen Aug 16, 2023
a1f066b
reset timer after Advance to retrieve "wait time"
DeniseWorthen Aug 21, 2023
c7876eb
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Aug 23, 2023
aa22374
Merge branch 'feature/runtime' into feature/updcice
DeniseWorthen Aug 23, 2023
897ea65
add logical control for enabling runtime info
DeniseWorthen Aug 23, 2023
48cf726
Merge branch 'feature/runtime' into feature/updcice
DeniseWorthen Aug 23, 2023
76c3f7f
remove zsal items from cap
DeniseWorthen Aug 23, 2023
84427a6
fix typo
DeniseWorthen Aug 23, 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
11 changes: 4 additions & 7 deletions cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ subroutine init_restart()
restart_iso, read_restart_iso, &
restart_aero, read_restart_aero, &
restart_hbrine, read_restart_hbrine, &
restart_zsal, restart_bgc
restart_bgc
use ice_restart_driver, only: restartfile
use ice_restart_shared, only: runtype, restart
use ice_state ! almost everything
Expand All @@ -243,7 +243,7 @@ subroutine init_restart()
logical(kind=log_kind) :: &
tr_iage, tr_FY, tr_lvl, tr_pond_lvl, &
tr_pond_topo, tr_fsd, tr_iso, tr_aero, tr_brine, tr_snow, &
skl_bgc, z_tracers, solve_zsal
skl_bgc, z_tracers
integer(kind=int_kind) :: &
ntrcr
integer(kind=int_kind) :: &
Expand All @@ -259,8 +259,7 @@ subroutine init_restart()
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

call icepack_query_parameters(skl_bgc_out=skl_bgc, &
z_tracers_out=z_tracers, solve_zsal_out=solve_zsal)
call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers)
call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, &
tr_lvl_out=tr_lvl, tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_topo_out=tr_pond_topo, tr_aero_out=tr_aero, tr_brine_out=tr_brine, &
Expand Down Expand Up @@ -404,8 +403,6 @@ subroutine init_restart()
if (trim(runtype) == 'continue') then
if (tr_brine) &
restart_hbrine = .true.
if (solve_zsal) &
restart_zsal = .true.
if (skl_bgc .or. z_tracers) &
restart_bgc = .true.
endif
Expand All @@ -415,7 +412,7 @@ subroutine init_restart()
if (tr_brine .and. restart_hbrine) call read_restart_hbrine
endif

if (solve_zsal .or. skl_bgc .or. z_tracers) then ! biogeochemistry
if (skl_bgc .or. z_tracers) then ! biogeochemistry
if (tr_fsd) then
write (nu_diag,*) 'FSD implementation incomplete for use with BGC'
call icepack_warnings_flush(nu_diag)
Expand Down
39 changes: 23 additions & 16 deletions cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module CICE_RunMod

use ice_kinds_mod
use cice_wrapper_mod, only : t_startf, t_stopf, t_barrierf
use cice_wrapper_mod, only : ufs_logfhour
use ice_fileunits, only: nu_diag
use ice_arrays_column, only: oceanmixed_ice
use ice_constants, only: c0, c1
Expand Down Expand Up @@ -107,11 +108,13 @@ end subroutine CICE_Run

subroutine ice_step

use ice_constants, only: c3600
use ice_boundary, only: ice_HaloUpdate
use ice_calendar, only: dt, dt_dyn, ndtd, diagfreq, write_restart, istep
use ice_calendar, only: idate, msec
use ice_calendar, only: idate, myear, mmonth, mday, msec, timesecs
use ice_calendar, only: calendar_sec2hms, write_history, nstreams, histfreq
use ice_diagnostics, only: init_mass_diags, runtime_diags, debug_model, debug_ice
use ice_diagnostics_bgc, only: hbrine_diags, zsal_diags, bgc_diags
use ice_diagnostics_bgc, only: hbrine_diags, bgc_diags
use ice_domain, only: halo_info, nblocks
use ice_dyn_eap, only: write_restart_eap
use ice_dyn_shared, only: kdyn, kridge
Expand All @@ -133,7 +136,7 @@ subroutine ice_step
use ice_timers, only: ice_timer_start, ice_timer_stop, &
timer_diags, timer_column, timer_thermo, timer_bound, &
timer_hist, timer_readwrite
use ice_communicate, only: MPI_COMM_ICE
use ice_communicate, only: MPI_COMM_ICE, my_task, master_task
use ice_prescribed_mod

integer (kind=int_kind) :: &
Expand All @@ -147,11 +150,13 @@ subroutine ice_step
logical (kind=log_kind) :: &
tr_iage, tr_FY, tr_lvl, tr_fsd, tr_snow, &
tr_pond_lvl, tr_pond_topo, tr_brine, tr_iso, tr_aero, &
calc_Tsfc, skl_bgc, solve_zsal, z_tracers, wave_spec
calc_Tsfc, skl_bgc, z_tracers, wave_spec

character(len=*), parameter :: subname = '(ice_step)'

character (len=char_len) :: plabeld
integer (kind=int_kind) :: hh,mm,ss,ns
character (len=char_len) :: logmsg

if (debug_model) then
plabeld = 'beginning time step'
Expand All @@ -161,8 +166,7 @@ subroutine ice_step
endif

call icepack_query_parameters(calc_Tsfc_out=calc_Tsfc, skl_bgc_out=skl_bgc, &
solve_zsal_out=solve_zsal, z_tracers_out=z_tracers, ktherm_out=ktherm, &
wave_spec_out=wave_spec)
z_tracers_out=z_tracers, ktherm_out=ktherm, wave_spec_out=wave_spec)
call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, &
tr_lvl_out=tr_lvl, tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_topo_out=tr_pond_topo, tr_brine_out=tr_brine, tr_aero_out=tr_aero, &
Expand Down Expand Up @@ -354,7 +358,6 @@ subroutine ice_step
call ice_timer_start(timer_diags) ! diagnostics
if (mod(istep,diagfreq) == 0) then
call runtime_diags(dt) ! log file
if (solve_zsal) call zsal_diags
if (skl_bgc .or. z_tracers) call bgc_diags
if (tr_brine) call hbrine_diags
endif
Expand All @@ -376,15 +379,23 @@ subroutine ice_step
if (tr_fsd) call write_restart_fsd
if (tr_iso) call write_restart_iso
if (tr_aero) call write_restart_aero
if (solve_zsal .or. skl_bgc .or. z_tracers) &
if (skl_bgc .or. z_tracers) &
call write_restart_bgc
if (tr_brine) call write_restart_hbrine
if (kdyn == 2) call write_restart_eap
call final_restart
endif

call ice_timer_stop(timer_readwrite) ! reading/writing

if (my_task == master_task) then
do ns = 1,nstreams
if (write_history(ns) .and. histfreq(ns) .eq. 'h') then
call calendar_sec2hms(msec,hh,mm,ss)
write(logmsg,'(6(i4,2x))')myear,mmonth,mday,hh,mm,ss
call ufs_logfhour(trim(logmsg),timesecs/c3600)
end if
end do
end if
end subroutine ice_step

!=======================================================================
Expand All @@ -396,7 +407,7 @@ end subroutine ice_step
subroutine coupling_prep (iblk)

use ice_arrays_column, only: alvdfn, alidfn, alvdrn, alidrn, &
albicen, albsnon, albpndn, apeffn, fzsal_g, fzsal, snowfracn
albicen, albsnon, albpndn, apeffn, snowfracn
use ice_blocks, only: nx_block, ny_block, get_block, block
use ice_domain, only: blocks_ice
use ice_calendar, only: dt, nstreams
Expand All @@ -411,9 +422,8 @@ subroutine coupling_prep (iblk)
fsens, flat, fswabs, flwout, evap, Tref, Qref, &
scale_fluxes, frzmlt_init, frzmlt, Uref, wind
use ice_flux_bgc, only: faero_ocn, fiso_ocn, Qref_iso, fiso_evap, &
fzsal_ai, fzsal_g_ai, flux_bio, flux_bio_ai, &
fnit, fsil, famm, fdmsp, fdms, fhum, fdust, falgalN, &
fdoc, fdic, fdon, ffep, ffed, bgcflux_ice_to_ocn
flux_bio, flux_bio_ai, fnit, fsil, famm, fdmsp, fdms, fhum, &
fdust, falgalN, fdoc, fdic, fdon, ffep, ffed, bgcflux_ice_to_ocn
use ice_grid, only: tmask
use ice_state, only: aicen, aice
use ice_state, only: aice_init
Expand Down Expand Up @@ -566,8 +576,6 @@ subroutine coupling_prep (iblk)
fsalt_ai (i,j,iblk) = fsalt (i,j,iblk)
fhocn_ai (i,j,iblk) = fhocn (i,j,iblk)
fswthru_ai(i,j,iblk) = fswthru(i,j,iblk)
fzsal_ai (i,j,iblk) = fzsal (i,j,iblk)
fzsal_g_ai(i,j,iblk) = fzsal_g(i,j,iblk)

if (nbtrcr > 0) then
do k = 1, nbtrcr
Expand Down Expand Up @@ -613,7 +621,6 @@ subroutine coupling_prep (iblk)
faero_ocn(:,:,:,iblk), &
alvdr (:,:,iblk), alidr (:,:,iblk), &
alvdf (:,:,iblk), alidf (:,:,iblk), &
fzsal (:,:,iblk), fzsal_g (:,:,iblk), &
flux_bio (:,:,1:nbtrcr,iblk), &
Qref_iso =Qref_iso (:,:,:,iblk), &
fiso_evap=fiso_evap(:,:,:,iblk), &
Expand Down
84 changes: 76 additions & 8 deletions cicecore/drivers/nuopc/cmeps/cice_wrapper_mod.F90
Original file line number Diff line number Diff line change
@@ -1,25 +1,93 @@
module cice_wrapper_mod

#ifdef CESMCOUPLED
use perf_mod , only : t_startf, t_stopf, t_barrierf
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit
use perf_mod , only : t_startf, t_stopf, t_barrierf
use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit

use ice_kinds_mod , only : dbl_kind, int_kind, char_len, char_len_long

implicit none

real(dbl_kind) :: wtime = 0.0
contains
! Define stub routines that do nothing - they are just here to avoid
! having cppdefs in the main program
subroutine ufs_settimer(timevalue)
real(dbl_kind), intent(inout) :: timevalue
end subroutine ufs_settimer
subroutine ufs_logtimer(nunit,elapsedsecs,string,runtimelog,time0)
integer, intent(in) :: nunit
integer(int_kind), intent(in) :: elapsedsecs
character(len=*), intent(in) :: string
logical, intent(in) :: runtimelog
real(dbl_kind), intent(in) :: time0
end subroutine ufs_logtimer
subroutine ufs_file_setLogUnit(filename,nunit,runtimelog)
character(len=*), intent(in) :: filename
logical, intent(in) :: runtimelog
integer, intent(out) :: nunit
end subroutine ufs_file_setLogUnit
subroutine ufs_logfhour(msg,hour)
character(len=*), intent(in) :: msg
real(dbl_kind), intent(in) :: hour
end subroutine ufs_logfhour
#else

use ice_kinds_mod , only : dbl_kind, int_kind, char_len, char_len_long

implicit none

real(dbl_kind) :: wtime = 0.0
contains
subroutine ufs_settimer(timevalue)
real(dbl_kind), intent(inout) :: timevalue
real(dbl_kind) :: MPI_Wtime
timevalue = MPI_Wtime()
end subroutine ufs_settimer

subroutine ufs_logtimer(nunit,elapsedsecs,string,runtimelog,time0)
integer, intent(in) :: nunit
integer(int_kind), intent(in) :: elapsedsecs
character(len=*), intent(in) :: string
logical, intent(in) :: runtimelog
real(dbl_kind), intent(in) :: time0
real(dbl_kind) :: MPI_Wtime, timevalue
if (.not. runtimelog) return
if (time0 > 0.) then
timevalue = MPI_Wtime()-time0
write(nunit,*)elapsedsecs,' CICE '//trim(string),timevalue
end if
end subroutine ufs_logtimer

! These are just stub routines put in place to remove
subroutine ufs_file_setLogUnit(filename,nunit,runtimelog)
character(len=*), intent(in) :: filename
logical, intent(in) :: runtimelog
integer, intent(out) :: nunit
if (.not. runtimelog) return
open (newunit=nunit, file=trim(filename))
end subroutine ufs_file_setLogUnit

subroutine ufs_logfhour(msg,hour)
character(len=*), intent(in) :: msg
real(dbl_kind), intent(in) :: hour
character(len=char_len) :: filename
integer(int_kind) :: nunit
write(filename,'(a,i3.3)')'log.ice.f',int(hour)
open(newunit=nunit,file=trim(filename))
write(nunit,'(a)')'completed: cice'
write(nunit,'(a,f10.3)')'forecast hour:',hour
write(nunit,'(a)')'valid time: '//trim(msg)
close(nunit)
end subroutine ufs_logfhour

! Define stub routines that do nothing - they are just here to avoid
! having cppdefs in the main program
subroutine shr_file_setLogUnit(nunit)
integer, intent(in) :: nunit
! do nothing for this stub - its just here to replace
! having cppdefs in the main program
end subroutine shr_file_setLogUnit
subroutine shr_file_getLogUnit(nunit)
integer, intent(in) :: nunit
! do nothing for this stub - its just here to replace
! having cppdefs in the main program
end subroutine shr_file_getLogUnit

subroutine t_startf(string)
character(len=*) :: string
end subroutine t_startf
Expand Down
27 changes: 24 additions & 3 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module ice_comp_nuopc
use icepack_intfc , only : icepack_query_tracer_flags, icepack_query_parameters
use cice_wrapper_mod , only : t_startf, t_stopf, t_barrierf
use cice_wrapper_mod , only : shr_file_getlogunit, shr_file_setlogunit
use cice_wrapper_mod , only : ufs_settimer, ufs_logtimer, ufs_file_setlogunit, wtime
#ifdef CESMCOUPLED
use shr_const_mod
use shr_orb_mod , only : shr_orb_decl, shr_orb_params, SHR_ORB_UNDEF_REAL, SHR_ORB_UNDEF_INT
Expand Down Expand Up @@ -87,11 +88,12 @@ module ice_comp_nuopc

type(ESMF_Mesh) :: ice_mesh

integer :: nthrds ! Number of threads to use in this component

integer :: nthrds ! Number of threads to use in this component
integer :: nu_timer = 6 ! Simple timer log, unused except by UFS
integer :: dbug = 0
logical :: profile_memory = .false.
logical :: mastertask
logical :: runtimelog = .false.
integer :: start_ymd ! Start date (YYYYMMDD)
integer :: start_tod ! start time of day (s)
integer :: curr_ymd ! Current date (YYYYMMDD)
Expand Down Expand Up @@ -245,6 +247,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
character(len=*), parameter :: subname=trim(modName)//':(InitializeAdvertise) '
!--------------------------------

call ufs_settimer(wtime)

call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldName", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
Expand Down Expand Up @@ -305,6 +309,12 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
write(logmsg,'(i6)') dbug
call ESMF_LogWrite('CICE_cap: dbug = '//trim(logmsg), ESMF_LOGMSG_INFO)

call NUOPC_CompAttributeGet(gcomp, name="RunTimeLog", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) runtimelog=(trim(cvalue)=="true")
write(logmsg,*) runtimelog
call ESMF_LogWrite('CICE_cap:RunTimeLog = '//trim(logmsg), ESMF_LOGMSG_INFO)

!----------------------------------------------------------------------------
! generate local mpi comm
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -487,6 +497,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! Set the nu_diag_set flag so it's not reset later

call shr_file_setLogUnit (shrlogunit)
call ufs_file_setLogUnit('./log.ice.timer',nu_timer,runtimelog)

call NUOPC_CompAttributeGet(gcomp, name="diro", value=cvalue, &
isPresent=isPresent, isSet=isSet, rc=rc)
Expand Down Expand Up @@ -699,7 +710,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if

call t_stopf ('cice_init_total')

if (mastertask) call ufs_logtimer(nu_timer,msec,'InitializeAdvertise time: ',runtimelog,wtime)
end subroutine InitializeAdvertise

!===============================================================================
Expand Down Expand Up @@ -735,6 +746,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

call ufs_settimer(wtime)
!----------------------------------------------------------------------------
! Second cice initialization phase -after initializing grid info
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -912,6 +924,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)

call flush_fileunit(nu_diag)

if (mastertask) call ufs_logtimer(nu_timer,msec,'InitializeRealize time: ',runtimelog,wtime)
end subroutine InitializeRealize

!===============================================================================
Expand Down Expand Up @@ -957,6 +970,8 @@ subroutine ModelAdvance(gcomp, rc)
!--------------------------------

rc = ESMF_SUCCESS
if (mastertask) call ufs_logtimer(nu_timer,msec,'ModelAdvance time since last step: ',runtimelog,wtime)
call ufs_settimer(wtime)

call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

Expand Down Expand Up @@ -1177,6 +1192,9 @@ subroutine ModelAdvance(gcomp, rc)

if (dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO)

if (mastertask) call ufs_logtimer(nu_timer,msec,'ModelAdvance time: ',runtimelog,wtime)
call ufs_settimer(wtime)

end subroutine ModelAdvance

!===============================================================================
Expand Down Expand Up @@ -1321,6 +1339,7 @@ subroutine ModelFinalize(gcomp, rc)
!--------------------------------

rc = ESMF_SUCCESS
call ufs_settimer(wtime)
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)
if (my_task == master_task) then
write(nu_diag,F91)
Expand All @@ -1329,6 +1348,8 @@ subroutine ModelFinalize(gcomp, rc)
end if
if (dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO)

if(mastertask) call ufs_logtimer(nu_timer,msec,'ModelFinalize time: ',runtimelog,wtime)

end subroutine ModelFinalize

!===============================================================================
Expand Down
Loading