Skip to content

Commit 37a53bc

Browse files
committed
reorganize file structure
1 parent e6c5ddd commit 37a53bc

2 files changed

Lines changed: 25 additions & 20 deletions

File tree

config_src/mct_driver/coupler_indices.F90

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module coupler_indices
1111
use MOM_grid, only : ocean_grid_type
1212
use MOM_surface_forcing, only: ice_ocean_boundary_type
1313
! MOM functions
14-
use MOM_domains, only : pass_var
14+
use MOM_domains, only : pass_var, AGRID
1515
use ocean_model_mod, only : ocean_public_type
1616

1717
implicit none
@@ -332,36 +332,38 @@ subroutine fill_ice_ocean_bnd(ice_ocean_boundary, grid, x2o_o, ind)
332332
k = k + 1 ! Increment position within gindex
333333
ig = i + grid%idg_offset
334334
! zonal wind stress (taux)
335-
ice_ocean_boundary%u_flux(i,j) = x2o_o(ind%x2o_Foxx_taux,k)
335+
ice_ocean_boundary%u_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_taux,k)
336336
! meridional wind stress (tauy)
337-
ice_ocean_boundary%v_flux(i,j) = x2o_o(ind%x2o_Foxx_tauy,k)
337+
ice_ocean_boundary%v_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_tauy,k)
338338
! sensible heat flux
339-
ice_ocean_boundary%t_flux(i,j) = x2o_o(ind%x2o_Foxx_sen,k)
339+
ice_ocean_boundary%t_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_sen,k)
340340
! salt flux
341-
ice_ocean_boundary%salt_flux(i,j) = x2o_o(ind%x2o_Fioi_salt,k)
341+
ice_ocean_boundary%salt_flux(ig,jg) = 0.0 ! x20_o(ind%x2o_Fioi_salt,k)
342342
! heat flux from snow & ice melt
343-
ice_ocean_boundary%calving_hflx(i,j) = x2o_o(ind%x2o_Fioi_melth,k)
343+
ice_ocean_boundary%calving_hflx(ig,jg) = 0.0 ! x20_o(ind%x2o_Fioi_melth,k)
344344
! snow melt flux
345-
ice_ocean_boundary%fprec(i,j) = x2o_o(ind%x2o_Fioi_meltw,k)
345+
ice_ocean_boundary%fprec(ig,jg) = 0.0 ! x20_o(ind%x2o_Fioi_meltw,k)
346346
! river runoff flux
347-
ice_ocean_boundary%runoff(i,j) = x2o_o(ind%x2o_Foxx_rofl,k)
347+
ice_ocean_boundary%runoff(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_rofl,k)
348348
! ice runoff flux
349-
ice_ocean_boundary%calving(i,j) = x2o_o(ind%x2o_Foxx_rofi,k)
349+
ice_ocean_boundary%calving(ig,jg) = 0.0 ! x20_o(ind%x2o_Foxx_rofi,k)
350350
! liquid precipitation (rain)
351-
ice_ocean_boundary%lprec(i,j) = x2o_o(ind%x2o_Faxa_rain,k)
351+
ice_ocean_boundary%lprec(ig,jg) = 0.0 ! x20_o(ind%x2o_Faxa_rain,k)
352352
! froze precipitation (snow)
353-
ice_ocean_boundary%fprec(i,j) = x2o_o(ind%x2o_Faxa_snow,k)
353+
ice_ocean_boundary%fprec(ig,jg) = 0.0 ! x20_o(ind%x2o_Faxa_snow,k)
354354
!!!!!!! LONGWAVE NEEDS TO BE FIXED !!!!!!!
355355
! longwave radiation (up)
356-
ice_ocean_boundary%lw_flux(i,j) = x2o_o(k,ind%x2o_Foxx_lwup)
356+
ice_ocean_boundary%lw_flux(ig,jg) = 0.0 ! x20_o(k,ind%x2o_Foxx_lwup)
357357
! longwave radiation (down)
358-
ice_ocean_boundary%lw_flux(i,j) = x2o_o(k,ind%x2o_Faxa_lwdn)
358+
ice_ocean_boundary%lw_flux(ig,jg) = 0.0 ! x20_o(k,ind%x2o_Faxa_lwdn)
359359
!!!!!!! SHORTWAVE NEEDS TO BE COMBINED !!!!!!!
360360
! net short-wave heat flux
361-
ice_ocean_boundary%u_flux(i,j) = x2o_o(k,ind%x2o_Foxx_swnet)
361+
ice_ocean_boundary%u_flux(ig,jg) = 0.0 ! x20_o(k,ind%x2o_Foxx_swnet)
362362
enddo
363363
enddo
364364

365+
ice_ocean_boundary%wind_stagger = AGRID
366+
365367
end subroutine fill_ice_ocean_bnd
366368

367369
end module coupler_indices

config_src/mct_driver/ocn_comp_mct.F90

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module ocn_comp_mct
4242
use MOM_grid, only: ocean_grid_type, get_global_grid_size
4343
use MOM_variables, only: surface
4444
use MOM_error_handler, only: MOM_error, FATAL, is_root_pe
45-
use MOM_time_manager, only: time_type, set_date, set_calendar_type, NOLEAP
45+
use MOM_time_manager, only: time_type, set_date, set_time, set_calendar_type, NOLEAP
4646
use coupler_indices, only: coupler_indices_init, cpl_indices
4747
use coupler_indices, only: ocn_export, fill_ice_ocean_bnd
4848
!
@@ -313,9 +313,11 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
313313
! Size of global domain
314314
call get_global_grid_size(glb%grid, ni, nj)
315315

316-
! allocate ice_ocean_boundary
317-
isc = glb%grid%isc; iec = glb%grid%iec;
318-
jsc = glb%grid%jsc; jec = glb%grid%jec;
316+
! Allocate ice_ocean_boundary using global indexing without halos
317+
isc = glb%grid%isc + glb%grid%idg_offset
318+
iec = glb%grid%iec + glb%grid%idg_offset
319+
jsc = glb%grid%jsc + glb%grid%jdg_offset
320+
jec = glb%grid%jec + glb%grid%jdg_offset
319321
allocate(glb%ice_ocean_boundary%u_flux(isc:iec,jsc:jec)); glb%ice_ocean_boundary%u_flux(:,:) = 0.0
320322
allocate(glb%ice_ocean_boundary%v_flux(isc:iec,jsc:jec)); glb%ice_ocean_boundary%v_flux(:,:) = 0.0
321323
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)
392394
if (debug .and. is_root_pe()) then
393395
write(6,*) 'ocn_run_mct, time step: y,m,d-',year,month,day,'s,sn,sd=',seconds,seconds_n,seconds_d
394396
endif
397+
coupling_timestep = set_time(seconds, days=day, err_msg=err_msg)
395398

396399
! set (actually, get from mct) the cdata pointers:
397400
! \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)
406409
call fill_ice_ocean_bnd(glb%ice_ocean_boundary, glb%grid, x2o_o%rattr, glb%ind)
407410
if (debug .and. is_root_pe()) write(6,*) 'fill_ice_ocean_bnd'
408411

409-
! call update_ocean_model(glb%ice_ocean_boundary, glb%ocn_state, glb%ocn_public, &
410-
! time_start, coupling_timestep)
412+
call update_ocean_model(glb%ice_ocean_boundary, glb%ocn_state, glb%ocn_public, &
413+
time_start, coupling_timestep)
411414

412415
end subroutine ocn_run_mct
413416

0 commit comments

Comments
 (0)