Skip to content

Commit

Permalink
Merge branch 'dev/ncar' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Jul 25, 2017
2 parents f7c26a5 + cd58e2a commit 4d346ca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
30 changes: 16 additions & 14 deletions config_src/mct_driver/coupler_indices.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
13 changes: 8 additions & 5 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,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
Expand Down Expand Up @@ -335,6 +337,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%?
Expand All @@ -349,8 +352,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

Expand Down

0 comments on commit 4d346ca

Please sign in to comment.