diff --git a/config_src/mct_driver/coupler_indices.F90 b/config_src/mct_driver/coupler_indices.F90 index 0021439726..0d3cbb4f93 100644 --- a/config_src/mct_driver/coupler_indices.F90 +++ b/config_src/mct_driver/coupler_indices.F90 @@ -11,7 +11,7 @@ module coupler_indices use MOM_grid, only : ocean_grid_type use MOM_surface_forcing, only: ice_ocean_boundary_type ! MOM functions - use MOM_domains, only : pass_var + use MOM_domains, only : pass_var, AGRID use ocean_model_mod, only : ocean_public_type implicit none @@ -332,36 +332,38 @@ subroutine fill_ice_ocean_bnd(ice_ocean_boundary, grid, x2o_o, ind) k = k + 1 ! Increment position within gindex ig = i + grid%idg_offset ! zonal wind stress (taux) - ice_ocean_boundary%u_flux(i,j) = x2o_o(ind%x2o_Foxx_taux,k) + ice_ocean_boundary%u_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_taux,k) ! meridional wind stress (tauy) - ice_ocean_boundary%v_flux(i,j) = x2o_o(ind%x2o_Foxx_tauy,k) + ice_ocean_boundary%v_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_tauy,k) ! sensible heat flux - ice_ocean_boundary%t_flux(i,j) = x2o_o(ind%x2o_Foxx_sen,k) + ice_ocean_boundary%t_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_sen,k) ! salt flux - ice_ocean_boundary%salt_flux(i,j) = x2o_o(ind%x2o_Fioi_salt,k) + ice_ocean_boundary%salt_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Fioi_salt,k) ! heat flux from snow & ice melt - ice_ocean_boundary%calving_hflx(i,j) = x2o_o(ind%x2o_Fioi_melth,k) + ice_ocean_boundary%calving_hflx(ig,jg) = 0.0 ! x20_o(ind%x2o_Fioi_melth,k) ! snow melt flux - ice_ocean_boundary%fprec(i,j) = x2o_o(ind%x2o_Fioi_meltw,k) + ice_ocean_boundary%fprec(ig,jg) = 0.0 ! x20_o(ind%x2o_Fioi_meltw,k) ! river runoff flux - ice_ocean_boundary%runoff(i,j) = x2o_o(ind%x2o_Foxx_rofl,k) + ice_ocean_boundary%runoff(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_rofl,k) ! ice runoff flux - ice_ocean_boundary%calving(i,j) = x2o_o(ind%x2o_Foxx_rofi,k) + ice_ocean_boundary%calving(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_rofi,k) ! liquid precipitation (rain) - ice_ocean_boundary%lprec(i,j) = x2o_o(ind%x2o_Faxa_rain,k) + ice_ocean_boundary%lprec(ig,jg) = 0.0 ! x20_o(ind%x2o_Faxa_rain,k) ! froze precipitation (snow) - ice_ocean_boundary%fprec(i,j) = x2o_o(ind%x2o_Faxa_snow,k) + ice_ocean_boundary%fprec(ig,jg) = 0.0 ! x20_o(ind%x2o_Faxa_snow,k) !!!!!!! LONGWAVE NEEDS TO BE FIXED !!!!!!! ! longwave radiation (up) - ice_ocean_boundary%lw_flux(i,j) = x2o_o(k,ind%x2o_Foxx_lwup) + ice_ocean_boundary%lw_flux(ig,jg) = 0.0 ! x20_o(k,ind%x2o_Foxx_lwup) ! longwave radiation (down) - ice_ocean_boundary%lw_flux(i,j) = x2o_o(k,ind%x2o_Faxa_lwdn) + ice_ocean_boundary%lw_flux(ig,jg) = 0.0 ! x20_o(k,ind%x2o_Faxa_lwdn) !!!!!!! SHORTWAVE NEEDS TO BE COMBINED !!!!!!! ! net short-wave heat flux - ice_ocean_boundary%u_flux(i,j) = x2o_o(k,ind%x2o_Foxx_swnet) + ice_ocean_boundary%u_flux(ig,jg) = 0.0 ! x20_o(k,ind%x2o_Foxx_swnet) enddo enddo + ice_ocean_boundary%wind_stagger = AGRID + end subroutine fill_ice_ocean_bnd end module coupler_indices diff --git a/config_src/mct_driver/ocn_comp_mct.F90 b/config_src/mct_driver/ocn_comp_mct.F90 index 3f4081b945..a94b015811 100644 --- a/config_src/mct_driver/ocn_comp_mct.F90 +++ b/config_src/mct_driver/ocn_comp_mct.F90 @@ -42,7 +42,7 @@ module ocn_comp_mct use MOM_grid, only: ocean_grid_type, get_global_grid_size use MOM_variables, only: surface use MOM_error_handler, only: MOM_error, FATAL, is_root_pe - use MOM_time_manager, only: time_type, set_date, set_calendar_type, NOLEAP + use MOM_time_manager, only: time_type, set_date, set_time, set_calendar_type, NOLEAP use coupler_indices, only: coupler_indices_init, cpl_indices use coupler_indices, only: ocn_export, fill_ice_ocean_bnd ! @@ -313,9 +313,11 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename ) ! Size of global domain call get_global_grid_size(glb%grid, ni, nj) - ! allocate ice_ocean_boundary - isc = glb%grid%isc; iec = glb%grid%iec; - jsc = glb%grid%jsc; jec = glb%grid%jec; + ! Allocate ice_ocean_boundary using global indexing without halos + isc = glb%grid%isc + glb%grid%idg_offset + iec = glb%grid%iec + glb%grid%idg_offset + jsc = glb%grid%jsc + glb%grid%jdg_offset + jec = glb%grid%jec + glb%grid%jdg_offset allocate(glb%ice_ocean_boundary%u_flux(isc:iec,jsc:jec)); glb%ice_ocean_boundary%u_flux(:,:) = 0.0 allocate(glb%ice_ocean_boundary%v_flux(isc:iec,jsc:jec)); glb%ice_ocean_boundary%v_flux(:,:) = 0.0 allocate(glb%ice_ocean_boundary%t_flux(isc:iec,jsc:jec)); glb%ice_ocean_boundary%t_flux(:,:) = 0.0 @@ -392,6 +394,7 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o) if (debug .and. is_root_pe()) then write(6,*) 'ocn_run_mct, time step: y,m,d-',year,month,day,'s,sn,sd=',seconds,seconds_n,seconds_d endif + coupling_timestep = set_time(seconds, days=day, err_msg=err_msg) ! set (actually, get from mct) the cdata pointers: ! \todo this was done in _init_, is it needed again. Does this infodata need to be in glb%? @@ -406,8 +409,8 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o) call fill_ice_ocean_bnd(glb%ice_ocean_boundary, glb%grid, x2o_o%rattr, glb%ind) if (debug .and. is_root_pe()) write(6,*) 'fill_ice_ocean_bnd' -! call update_ocean_model(glb%ice_ocean_boundary, glb%ocn_state, glb%ocn_public, & -! time_start, coupling_timestep) + call update_ocean_model(glb%ice_ocean_boundary, glb%ocn_state, glb%ocn_public, & + time_start, coupling_timestep) end subroutine ocn_run_mct