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

13 - coupler_intermediate restart #128

Merged
merged 61 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b0f4c62
add coupler_atmos_tracer_driver_gather_data, coupler_sfc_boundary_layer
mlee03 Jun 10, 2024
0d5b688
fix compiler errors
mlee03 Jun 10, 2024
0bc851c
dt_atmos is an integer?
mlee03 Jun 10, 2024
af41247
coupler_chksum_obj
mlee03 Jun 11, 2024
cc4f049
chksum object update
mlee03 Jun 11, 2024
f2840d3
omg
mlee03 Jun 12, 2024
91a1a03
turn of and on chksums
mlee03 Jun 12, 2024
066bd33
coupler_update_atmos_model_dynamics
mlee03 Jun 12, 2024
29c59ea
coupler_update_atmos_model_dynamics
mlee03 Jun 12, 2024
3bcdd2a
mistakes with concurrent radiation
mlee03 Jun 12, 2024
cae08b3
update_land_model_fast
mlee03 Jun 12, 2024
a59748f
compile error
mlee03 Jun 12, 2024
a213bf2
remove trailing whitespace
mlee03 Jun 12, 2024
9cb6438
intent(inout)
mlee03 Jun 12, 2024
3ef50f8
remove test stuff
mlee03 Jun 12, 2024
bced766
add update_atmos_model_state
mlee03 Jun 12, 2024
b80efda
lint
mlee03 Jun 12, 2024
3d5c71c
lint
mlee03 Jun 12, 2024
0fa24c9
chksum object
mlee03 Jun 13, 2024
ad69ed6
update to new coupler_chksum_obj
mlee03 Jun 13, 2024
115049b
comments
mlee03 Jun 14, 2024
4fa6c2d
add components_obj
mlee03 Jun 14, 2024
8a1b6f1
change subroutine names to get_chksums
mlee03 Jun 14, 2024
229094c
fix compile errors
mlee03 Jun 14, 2024
afa4063
add setters
mlee03 Jun 14, 2024
11964cb
change object int names to intialize
mlee03 Jun 14, 2024
0f5c41f
test
mlee03 Jun 14, 2024
0d57581
remove pointer
mlee03 Jun 14, 2024
f8ac255
Update full_coupler_mod.F90
mlee03 Jun 14, 2024
9620e6e
Merge remote-tracking branch 'origin/tracer_driver_sfc_boundary' into…
mlee03 Jun 14, 2024
7d67fdb
Merge remote-tracking branch 'origin/atmos_model-flux_down' into land…
mlee03 Jun 14, 2024
0c9450f
Merge remote-tracking branch 'origin/tracer_driver_sfc_boundary' into…
mlee03 Jun 14, 2024
caad35d
test
mlee03 Jun 14, 2024
5243119
test
mlee03 Jun 14, 2024
5000842
test with pointers
mlee03 Jun 17, 2024
b65f68f
add pointers and targets
mlee03 Jun 17, 2024
b0b4c05
undo test settings
mlee03 Jun 17, 2024
ff97935
Merge remote-tracking branch 'origin/tracer_driver_sfc_boundary' into…
mlee03 Jun 17, 2024
a903382
git merge is not smart
mlee03 Jun 17, 2024
2f249c4
coupler slow land to ice
mlee03 Jun 17, 2024
590032a
fix compile error
mlee03 Jun 17, 2024
7e02124
ocean
mlee03 Jun 17, 2024
7598c3d
restart and summary subroutines
mlee03 Jun 18, 2024
1b2e122
compile fix
mlee03 Jun 18, 2024
0247088
move termination to coupler_end
mlee03 Jun 18, 2024
5f0a25a
make summary public
mlee03 Jun 18, 2024
8fa02b6
stocks change that should have been undone in coupler_end
mlee03 Jun 18, 2024
dadb288
add Time_restart_current back
mlee03 Jun 20, 2024
65566d0
compile error and comments
mlee03 Jun 20, 2024
88f0cc5
add stocks back
mlee03 Jun 20, 2024
b9cf013
stocks
mlee03 Jun 20, 2024
dcd9f60
fix coupler_restart
mlee03 Jun 20, 2024
78bcc3b
fix compile errors
mlee03 Jun 20, 2024
e00fbd6
Merge remote-tracking branch 'fms/main' into coupler_restarts
mlee03 Jun 21, 2024
ca2e51c
fix compile error
mlee03 Jun 21, 2024
0dc27d5
fix spacing
mlee03 Jun 21, 2024
75a5b4e
fix merge issues
mlee03 Jun 21, 2024
a143296
add more detailed comments to coupler_end
mlee03 Jun 21, 2024
7e0b06d
add comments for tom and change outerloop name
Jun 25, 2024
d4b100d
add spce back in
Jun 25, 2024
c325f26
better commnets for time
Jun 25, 2024
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
62 changes: 16 additions & 46 deletions full/coupler_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,12 @@ program coupler_main
type(FmsNetcdfDomainFile_t), dimension(:), pointer :: Ice_bc_restart => NULL()
type(FmsNetcdfDomainFile_t), dimension(:), pointer :: Ocn_bc_restart => NULL()

type(FmsTime_type) :: Time_restart, Time_start, Time_end
type(FmsTime_type) :: Time_restart_current
character(len=32) :: timestamp
type(FmsTime_type) :: Time_restart, Time_start, Time_end, Time_restart_current

type(coupler_clock_type) :: coupler_clocks
type(coupler_components_type), target :: coupler_components_obj
type(coupler_chksum_type) :: coupler_chksum_obj

integer :: outunit
character(len=80) :: text
integer, allocatable :: ensemble_pelist(:, :)
integer, allocatable :: slow_ice_ocean_pelist(:)
integer :: conc_nthreads = 1
Expand Down Expand Up @@ -446,7 +442,8 @@ program coupler_main
if (check_stocks >= 0) call coupler_flux_init_finish_stocks(Time, Atm, Land, Ice, Ocean_state, &
coupler_clocks, init_stocks=.True.)

do nc = 1, num_cpld_calls
!> ocean/slow-ice integration loop
slow_integration_loop : do nc = 1, num_cpld_calls
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be named something like coupled_timestep_loop because it’s the coupled timestep


if (do_chksum) then
call coupler_chksum_obj%get_coupler_chksums('top_of_coupled_loop+', nc)
Expand Down Expand Up @@ -682,6 +679,7 @@ program coupler_main
if (do_ocean) call coupler_update_ocean_model(Ocean, Ocean_state, Ice_ocean_boundary,&
Time_ocean, Time_step_cpld, current_timestep, coupler_chksum_obj)
end if

! Get stocks from "Ice_ocean_boundary" and add them to Ocean stocks.
! This call is just for record keeping of stocks transfer and
! does not modify either Ocean or Ice_ocean_boundary
Expand All @@ -692,60 +690,32 @@ program coupler_main
Time = Time_ocean

call fms_mpp_clock_end(coupler_clocks%ocean)
end if

!--- write out intermediate restart file when needed.
if (Time >= Time_restart) then
Time_restart_current = Time
Time_restart = fms_time_manager_increment_date(Time, restart_interval(1), restart_interval(2), &
restart_interval(3), restart_interval(4), restart_interval(5), restart_interval(6) )
timestamp = fms_time_manager_date_to_string(time_restart_current)
outunit= fms_mpp_stdout()
write(outunit,*) '=> NOTE from program coupler: intermediate restart file is written and ', &
trim(timestamp),' is appended as prefix to each restart file name'
if (Atm%pe) then
call atmos_model_restart(Atm, timestamp)
call land_model_restart(timestamp)
call ice_model_restart(Ice, timestamp)
endif
if (Ocean%is_ocean_pe) then
call ocean_model_restart(Ocean_state, timestamp)
endif
call coupler_restart(Atm, Ice, Ocean, Ocn_bc_restart, Ice_bc_restart, &
Time, Time_restart_current, Time_start, Time_end, timestamp)
endif

!--------------
if (do_chksum) call coupler_chksum_obj%get_coupler_chksums('MAIN_LOOP+', nc)
write( text,'(a,i6)' )'Main loop at coupling timestep=', nc
call fms_memutils_print_memuse_stats(text)
outunit= fms_mpp_stdout()
if (fms_mpp_pe() == fms_mpp_root_pe() .and. Atm%pe .and. do_concurrent_radiation) then
write(outunit,102) 'At coupling step ', nc,' of ',num_cpld_calls, &
' Atm & Rad (imbalance): ',omp_sec(1),' (',imb_sec(1),') ',omp_sec(2),' (',imb_sec(2),')'
endif
!> write out intermediate restart file when needead.
if (Time >= Time_restart) &
call coupler_intermediate_restart(Atm, Ice, Ocean, Ocean_state, Ocn_bc_restart, Ice_bc_restart, &
Time, Time_restart, Time_restart_current, Time_start)

call coupler_summarize_timestep(current_timestep, num_cpld_calls, coupler_chksum_obj, Atm%pe, omp_sec, imb_sec)

omp_sec(:)=0.
imb_sec(:)=0.
call flush(outunit)

enddo
102 FORMAT(A17,i5,A4,i5,A24,f10.4,A2,f10.4,A3,f10.4,A2,f10.4,A1)
enddo slow_integration_loop

!-----------------------------------------------------------------------
if( check_stocks >=0 ) call coupler_flux_init_finish_stocks(Time, Atm, Land, Ice, Ocean_state, &
coupler_clocks, finish_stocks=.True.)
!-----------------------------------------------------------------------

call fms_mpp_set_current_pelist()
call fms_mpp_clock_end(coupler_clocks%main)
call fms_mpp_clock_begin(coupler_clocks%termination)

if (do_chksum) call coupler_chksum_obj%get_coupler_chksums('coupler_end-', nc)
call coupler_end(Atm, Land, Ice, Ocean, Ocean_state, Land_ice_atmos_boundary, Atmos_ice_boundary,&
Atmos_land_boundary, Ice_ocean_boundary, Ocean_ice_boundary, Ocn_bc_restart, Ice_bc_restart, &
Time, Time_start, Time_end, Time_restart_current, coupler_chksum_obj)

call fms_mpp_clock_end(coupler_clocks%termination)
nc, Time, Time_start, Time_end, Time_restart_current, coupler_chksum_obj, coupler_clocks)

call fms_memutils_print_memuse_stats( 'Memory HiWaterMark', always=.TRUE. )
call fms_memutils_print_memuse_stats( 'Memory HiWaterMark', always=.True. )
call fms_end

!-----------------------------------------------------------------------
Expand Down
Loading
Loading