Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/coupler_flux_oceanice_2' into co…
Browse files Browse the repository at this point in the history
…upler_fast_slow_ice
  • Loading branch information
mlee03 committed May 22, 2024
2 parents 48165b4 + d332ca6 commit 0da7d1b
Showing 1 changed file with 58 additions and 56 deletions.
114 changes: 58 additions & 56 deletions full/full_coupler_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1497,10 +1497,10 @@ end subroutine slow_ice_chksum
!! after you exit. This is only necessary if you need to return to the global pelist.
subroutine ocean_chksum(id, timestep, Ocean, Ice_ocean_boundary)

character(len=*), intent(in) :: id
integer , intent(in) :: timestep
type (ocean_public_type), intent(in) :: Ocean
type(ice_ocean_boundary_type), intent(in) :: Ice_ocean_boundary
character(len=*), intent(in) :: id !< ID labelling the set of CHECKSUMS
integer , intent(in) :: timestep !< Timestep
type (ocean_public_type), intent(in) :: Ocean !< Ocean
type(ice_ocean_boundary_type), intent(in) :: Ice_ocean_boundary !<Ice_ocean_boundary

call ocean_public_type_chksum(id, timestep, Ocean)
call ice_ocn_bnd_type_chksum( id, timestep, Ice_ocean_boundary)
Expand All @@ -1513,14 +1513,14 @@ subroutine coupler_set_clock_ids(coupler_clocks, Atm, Land, Ice, Ocean, ensemble

implicit none

type(coupler_clock_type), intent(inout) :: coupler_clocks
type(atmos_data_type), intent(in) :: Atm
type(land_data_type), intent(in) :: Land
type(ocean_public_type), intent(in) :: Ocean
type(ice_data_type), intent(in) :: Ice
integer, dimension(:), intent(in) :: slow_ice_ocean_pelist
integer, dimension(:,:), intent(in) :: ensemble_pelist
integer, intent(in) :: ensemble_id
type(coupler_clock_type), intent(inout) :: coupler_clocks !< coupler_clocks
type(atmos_data_type), intent(in) :: Atm !< Atm
type(land_data_type), intent(in) :: Land !< Land
type(ocean_public_type), intent(in) :: Ocean !< Ocean
type(ice_data_type), intent(in) :: Ice !< Ice
integer, dimension(:), intent(in) :: slow_ice_ocean_pelist !< slow_ice_ocean_pelist
integer, dimension(:,:), intent(in) :: ensemble_pelist !< ensemble_pelist
integer, intent(in) :: ensemble_id !< ensemble_id

!> initialization clock
if (Atm%pe) then
Expand All @@ -1533,8 +1533,8 @@ subroutine coupler_set_clock_ids(coupler_clocks, Atm, Land, Ice, Ocean, ensemble
endif
if (Ice%pe) then
if (Ice%shared_slow_fast_PEs) then ; call fms_mpp_set_current_pelist(Ice%pelist)
elseif (Ice%fast_ice_pe) then ; call fms_mpp_set_current_pelist(Ice%fast_pelist)
elseif (Ice%slow_ice_pe) then ; call fms_mpp_set_current_pelist(Ice%slow_pelist)
elseif (Ice%fast_ice_pe) then ; call fms_mpp_set_current_pelist(Ice%fast_pelist)
elseif (Ice%slow_ice_pe) then ; call fms_mpp_set_current_pelist(Ice%slow_pelist)
else ; call fms_mpp_error(FATAL, "All Ice%pes must be a part of Ice%fast_ice_pe or Ice%slow_ice_pe")
endif
coupler_clocks%ice_model_init = fms_mpp_clock_id( ' Init: ice_model_init ' )
Expand Down Expand Up @@ -1615,18 +1615,18 @@ subroutine coupler_atmos_ice_land_ocean_chksum(id, timestep, Atm, Land, Ice, Lan
Atmos_ice_boundary, Atmos_land_boundary, Ocean, Ice_ocean_boundary, Ocean_ice_boundary)

implicit none

character(len=*), intent(in) :: id
integer , intent(in) :: timestep
type(atmos_data_type), intent(in) :: Atm
type(land_data_type), intent(in) :: Land
type(ice_data_type), intent(in) :: Ice
type(land_ice_atmos_boundary_type), intent(in) :: Land_ice_atmos_boundary
type(atmos_ice_boundary_type), intent(in) :: Atmos_ice_boundary
type(atmos_land_boundary_type), intent(in) :: Atmos_land_boundary
type(ocean_public_type), intent(in) :: Ocean
type(ice_ocean_boundary_type), intent(in) :: Ice_ocean_boundary
type(ocean_ice_boundary_type), intent(in), optional :: Ocean_ice_boundary
character(len=*), intent(in) :: id !< ID labelling the set of checksums
integer , intent(in) :: timestep !< timestep
type(atmos_data_type), intent(in) :: Atm !< Atm
type(land_data_type), intent(in) :: Land !< Land
type(ice_data_type), intent(in) :: Ice !< Ice
type(land_ice_atmos_boundary_type), intent(in) :: Land_ice_atmos_boundary !< Land_ice_atmos_boundary
type(atmos_ice_boundary_type), intent(in) :: Atmos_ice_boundary !< Atmos_ice_boundary
type(atmos_land_boundary_type), intent(in) :: Atmos_land_boundary !< Atmos_land_boundary
type(ocean_public_type), intent(in) :: Ocean !< Ocean
type(ice_ocean_boundary_type), intent(in) :: Ice_ocean_boundary !< Ice_ocean_boundary
type(ocean_ice_boundary_type), intent(in), optional :: Ocean_ice_boundary !< Ocean_ice_boundary

if (Atm%pe) then
call fms_mpp_set_current_pelist(Atm%pelist)
Expand All @@ -1647,14 +1647,15 @@ subroutine coupler_flux_init_finish_stocks(Time, Atm, Land, Ice, Ocean_state, &
coupler_clocks, init_stocks, finish_stocks)

implicit none

type(FmsTime_type), intent(in) :: Time
type(atmos_data_type), intent(inout) :: Atm
type(land_data_type), intent(inout) :: Land
type(ice_data_type), intent(inout) :: Ice
type(ocean_state_type), pointer, intent(inout) :: Ocean_state
type(coupler_clock_type), intent(inout) :: coupler_clocks
logical, optional, intent(in) :: init_stocks, finish_stocks

type(FmsTime_type), intent(in) :: Time !< current Time
type(atmos_data_type), intent(inout) :: Atm !< Atm
type(land_data_type), intent(inout) :: Land !< Land
type(ice_data_type), intent(inout) :: Ice !< Ice
type(ocean_state_type), pointer, intent(inout) :: Ocean_state !< Ocean_state
type(coupler_clock_type), intent(inout) :: coupler_clocks !< coupler_clocks
logical, optional, intent(in) :: init_stocks, finish_stocks !< control flags to either call flux_init_stocks or
!! the final flux_check_stocks

logical :: init, finish

Expand All @@ -1678,19 +1679,19 @@ subroutine coupler_flux_init_finish_stocks(Time, Atm, Land, Ice, Ocean_state, &

end subroutine coupler_flux_init_finish_stocks

!> \brief This subroutine calls flux_init_stocks
!> \brief This subroutine calls flux_check_stocks
subroutine coupler_flux_check_stocks(nc, Time, Atm, Land, Ice, Ocean_state, coupler_clocks)

implicit none

integer, intent(in) :: nc
type(FmsTime_type), intent(in) :: Time
type(atmos_data_type), intent(inout) :: Atm
type(land_data_type), intent(inout) :: Land
type(ice_data_type), intent(inout) :: Ice
type(ocean_state_type), pointer, intent(inout) :: Ocean_state
type(coupler_clock_type), intent(inout) :: coupler_clocks

integer, intent(in) :: nc !< current outerloop timestep
type(FmsTime_type), intent(in) :: Time !< Time
type(atmos_data_type), intent(inout) :: Atm !< Atm
type(land_data_type), intent(inout) :: Land !< Land
type(ice_data_type), intent(inout) :: Ice !< Ice
type(ocean_state_type), pointer, intent(inout) :: Ocean_state !< Ocean_state
type(coupler_clock_type), intent(inout) :: coupler_clocks !< coupler_clocks
call fms_mpp_clock_begin(coupler_clocks%flux_check_stocks)
if (check_stocks*((nc-1)/check_stocks) == nc-1 .AND. nc > 1) then
call fms_mpp_set_current_pelist()
Expand All @@ -1705,11 +1706,11 @@ subroutine coupler_flux_ocean_to_ice(Ocean, Ice, Ocean_ice_boundary, coupler_clo

implicit none

type(ocean_public_type), intent(inout) :: Ocean
type(ice_data_type), intent(in) :: Ice
type(ocean_ice_boundary_type), intent(inout) :: Ocean_ice_boundary
type(coupler_clock_type), intent(inout) :: coupler_clocks
integer, dimension(:), intent(in) :: slow_ice_ocean_pelist
type(ocean_public_type), intent(inout) :: Ocean !< Ocean
type(ice_data_type), intent(in) :: Ice !< Ice
type(ocean_ice_boundary_type), intent(inout) :: Ocean_ice_boundary !< Ocean_ice_boundary
type(coupler_clock_type), intent(inout) :: coupler_clocks !< coupler_clocks
integer, dimension(:), intent(in) :: slow_ice_ocean_pelist !< slow_ice_ocean_pelist

!Redistribute quantities from Ocean to Ocean_ice_boundary

Expand All @@ -1730,14 +1731,15 @@ subroutine coupler_flux_ice_to_ocean(Ice, Ocean, Ice_ocean_boundary, coupler_clo

implicit none

type(ice_data_type), intent(inout) :: Ice
type(ocean_public_type), intent(inout) :: Ocean
type(ice_ocean_boundary_type), intent(inout) :: Ice_ocean_boundary
type(coupler_clock_type), intent(inout) :: coupler_clocks
integer, dimension(:), optional, intent(in) :: slow_ice_ocean_pelist
logical, optional, intent(in) :: set_current_slow_ice_ocean_pelist

logical :: set_current_slow_ice_ocean_pelist_in
type(ice_data_type), intent(inout) :: Ice !< Ice
type(ocean_public_type), intent(inout) :: Ocean !< Ocean
type(ice_ocean_boundary_type), intent(inout) :: Ice_ocean_boundary !< Ice_ocean_boundary
type(coupler_clock_type), intent(inout) :: coupler_clocks !< coupler_clocks
integer, dimension(:), optional, intent(in) :: slow_ice_ocean_pelist !< slow_ice_ocean_pelist
!> if true, will call mpp_set_current_pelist(slow_ice_ocean_pelist)
logical, optional, intent(in) :: set_current_slow_ice_ocean_pelist

logical :: set_current_slow_ice_ocean_pelist_in !< .F. by default; set to equal set_current_slow_ice_ocean_pelist

!> mpp_set_current_pelist(slow_ice_ocean_pelist) is not required if coupler_flux_ice_to_ocean is being called after
!! coupler_flux_ocean_to_ice: mpp_set_current_pelist(slow_ice_ocean_pelist) is called
Expand Down

0 comments on commit 0da7d1b

Please sign in to comment.