diff --git a/src/combined_ice_ocean_driver.F90 b/src/combined_ice_ocean_driver.F90 index 512255e9..c9ff864f 100644 --- a/src/combined_ice_ocean_driver.F90 +++ b/src/combined_ice_ocean_driver.F90 @@ -38,13 +38,15 @@ module combined_ice_ocean_driver use ocean_model_mod, only : update_ocean_model, ocean_model_end! , ocean_model_init use ocean_model_mod, only : ocean_public_type, ocean_state_type, ice_ocean_boundary_type +use coupler_types_mod, only: coupler_type_send_data, coupler_type_data_override +use coupler_types_mod, only: coupler_type_copy_data, coupler_type_redistribute_data use data_override_mod, only : data_override use diag_manager_mod, only : send_data use mpp_domains_mod, only : domain2D, mpp_get_layout, mpp_get_compute_domain implicit none ; private -public update_slow_ice_and_ocean, ice_ocean_driver_init, ice_ocean_driver_end +public :: update_slow_ice_and_ocean, ice_ocean_driver_init, ice_ocean_driver_end type, public :: ice_ocean_driver_type ; private logical :: CS_is_initialized = .false. @@ -247,12 +249,7 @@ subroutine direct_flux_ice_to_IOB( Time, Ice, IOB ) if (ASSOCIATED(IOB%q_flux)) IOB%q_flux(:,:) = Ice%flux_q(:,:) ! Extra fluxes - do n=1,IOB%fluxes%num_bcs ; do m=1,IOB%fluxes%bc(n)%num_fields - if ( associated(IOB%fluxes%bc(n)%field(m)%values) ) then - IOB%fluxes%bc(n)%field(m)%values(:,:) = Ice%ocean_fluxes%bc(n)%field(m)%values(:,:) - endif - enddo ; enddo - + call coupler_type_copy_data(Ice%ocean_fluxes, IOB%fluxes) ! These lines allow the data override code to reset the fluxes to the ocean. call data_override('OCN', 'u_flux', IOB%u_flux , Time ) @@ -282,14 +279,9 @@ subroutine direct_flux_ice_to_IOB( Time, Ice, IOB ) call data_override('OCN', 'mass_berg', IOB%mass_berg , Time) ! Override and output extra fluxes of tracers or gasses - do n=1,IOB%fluxes%num_bcs ; do m=1,IOB%fluxes%bc(n)%num_fields - call data_override('OCN', IOB%fluxes%bc(n)%field(m)%name, & - IOB%fluxes%bc(n)%field(m)%values, Time) - - ! Perform diagnostic output for the extra fluxes - used = send_data(IOB%fluxes%bc(n)%field(m)%id_diag, & - IOB%fluxes%bc(n)%field(m)%values, Time) - enddo ; enddo + call coupler_type_data_override('OCN', IOB%fluxes, Time ) + + call coupler_type_send_data(IOB%fluxes, Time ) end subroutine direct_flux_ice_to_IOB diff --git a/src/ice_boundary_types.F90 b/src/ice_boundary_types.F90 index ae754177..8d3bcdfe 100644 --- a/src/ice_boundary_types.F90 +++ b/src/ice_boundary_types.F90 @@ -6,7 +6,7 @@ !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! module ice_boundary_types -use coupler_types_mod, only : coupler_2d_bc_type, coupler_3d_bc_type +use coupler_types_mod, only : coupler_2d_bc_type, coupler_3d_bc_type, coupler_type_write_chksums use fms_mod, only : stdout use mpp_mod, only : mpp_chksum use mpp_parameter_mod, only : CGRID_NE, BGRID_NE, AGRID @@ -125,14 +125,7 @@ subroutine ocn_ice_bnd_type_chksum(id, timestep, bnd_type) ! write(outunit,100) 'ocn_ice_bnd_type%data ',mpp_chksum(bnd_type%data ) 100 FORMAT("CHECKSUM::",A32," = ",Z20) - do n = 1, bnd_type%fields%num_bcs !{ - do m = 1, bnd_type%fields%bc(n)%num_fields !{ - write(outunit,101) 'oibt%',trim(bnd_type%fields%bc(n)%name), & - trim(bnd_type%fields%bc(n)%field(m)%name), & - mpp_chksum(bnd_type%fields%bc(n)%field(m)%values) - enddo !} m - enddo !} n - 101 FORMAT("CHECKSUM::",A16,a,'%',a," = ",Z20) + call coupler_type_write_chksums(bnd_type%fields, outunit, 'oibt%') end subroutine ocn_ice_bnd_type_chksum diff --git a/src/ice_type.F90 b/src/ice_type.F90 index efd61507..0ce7e2b3 100644 --- a/src/ice_type.F90 +++ b/src/ice_type.F90 @@ -11,7 +11,7 @@ module ice_type_mod use fms_io_mod, only: save_restart, restore_state, query_initialized use fms_io_mod, only: register_restart_field, restart_file_type use time_manager_mod, only: time_type, time_type_to_real -use coupler_types_mod,only: coupler_2d_bc_type, coupler_3d_bc_type +use coupler_types_mod,only: coupler_2d_bc_type, coupler_3d_bc_type, coupler_type_write_chksums use SIS_hor_grid, only : SIS_hor_grid_type use ice_grid, only : ice_grid_type @@ -598,11 +598,7 @@ subroutine ice_data_type_chksum(id, timestep, Ice) write(outunit,100) 'ice_data_type%u_surf ',mpp_chksum(Ice%u_surf ) write(outunit,100) 'ice_data_type%v_surf ',mpp_chksum(Ice%v_surf ) - do n=1,Ice%ocean_fields%num_bcs ; do m=1,Ice%ocean_fields%bc(n)%num_fields - write(outunit,101) 'ice%', trim(Ice%ocean_fields%bc(n)%name), & - trim(Ice%ocean_fields%bc(n)%field(m)%name), & - mpp_chksum(Ice%ocean_fields%bc(n)%field(m)%values) - enddo ; enddo + call coupler_type_write_chksums(Ice%ocean_fields, outunit, 'ice%') endif if (Ice%slow_ice_PE) then @@ -633,7 +629,6 @@ subroutine ice_data_type_chksum(id, timestep, Ice) endif 100 FORMAT(" CHECKSUM::",A32," = ",Z20) -101 FORMAT(" CHECKSUM::",A16,a,'%',a," = ",Z20) end subroutine ice_data_type_chksum