Skip to content

Commit

Permalink
Filling ice_ocean_bnd - Draft
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Jul 25, 2017
1 parent 5cd8d7a commit b69ab33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 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 @@ -369,7 +369,7 @@ subroutine fill_ice_ocean_bnd(ice_ocean_boundary, grid, x2o_o, ind)
type(cpl_indices), intent(inout) :: ind

! local variables
integer :: i, j, k, var
integer :: i, j, k, ig, jg

! variable that are not in ice_ocean_boundary:
! latent (x2o_Foxx_lat)
Expand All @@ -393,35 +393,37 @@ subroutine fill_ice_ocean_bnd(ice_ocean_boundary, grid, x2o_o, ind)

! need wind_stress_multiplier?

write(*,*) 'max. k is:', (grid%jec-grid%jsc) * (grid%iec-grid%isc)
! Copy from x2o to ice_ocean_boundary. ice_ocean_boundary uses global indexing with no halos.
write(*,*) 'max. k is:', (grid%jec-grid%jsc+1) * (grid%iec-grid%isc+1)
! zonal wind stress (taux)
var = ind%x2o_Foxx_taux
write(*,*) 'taux', SIZE(x2o_o(:,var))
write(*,*) 'taux', SIZE(x2o_o(ind%x2o_Foxx_taux,:))
write(*,*) 'ice_ocean_boundary%u_flux', SIZE(ice_ocean_boundary%u_flux(:,:))
k = 0
do j = grid%jsc, grid%jec
jg = j + grid%jdg_offset
do i = grid%isc, grid%iec
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(k,ind%x2o_Foxx_taux)
ice_ocean_boundary%u_flux(i,j) = x2o_o(ind%x2o_Foxx_taux,k)
! meridional wind stress (tauy)
ice_ocean_boundary%v_flux(i,j) = x2o_o(k,ind%x2o_Foxx_tauy)
ice_ocean_boundary%v_flux(i,j) = x2o_o(ind%x2o_Foxx_tauy,k)
! sensible heat flux
ice_ocean_boundary%t_flux(i,j) = x2o_o(k,ind%x2o_Foxx_sen)
ice_ocean_boundary%t_flux(i,j) = x2o_o(ind%x2o_Foxx_sen,k)
! salt flux
ice_ocean_boundary%salt_flux(i,j) = x2o_o(k,ind%x2o_Fioi_salt)
ice_ocean_boundary%salt_flux(i,j) = x2o_o(ind%x2o_Fioi_salt,k)
! heat flux from snow & ice melt
ice_ocean_boundary%calving_hflx(i,j) = x2o_o(k,ind%x2o_Fioi_melth)
ice_ocean_boundary%calving_hflx(i,j) = x2o_o(ind%x2o_Fioi_melth,k)
! snow melt flux
ice_ocean_boundary%fprec(i,j) = x2o_o(k,ind%x2o_Fioi_meltw)
ice_ocean_boundary%fprec(i,j) = x2o_o(ind%x2o_Fioi_meltw,k)
! river runoff flux
ice_ocean_boundary%runoff(i,j) = x2o_o(k,ind%x2o_Foxx_rofl)
ice_ocean_boundary%runoff(i,j) = x2o_o(ind%x2o_Foxx_rofl,k)
! ice runoff flux
ice_ocean_boundary%calving(i,j) = x2o_o(k,ind%x2o_Foxx_rofi)
ice_ocean_boundary%calving(i,j) = x2o_o(ind%x2o_Foxx_rofi,k)
! liquid precipitation (rain)
ice_ocean_boundary%lprec(i,j) = x2o_o(k,ind%x2o_Faxa_rain)
ice_ocean_boundary%lprec(i,j) = x2o_o(ind%x2o_Faxa_rain,k)
! froze precipitation (snow)
ice_ocean_boundary%fprec(i,j) = x2o_o(k,ind%x2o_Faxa_snow)
ice_ocean_boundary%fprec(i,j) = x2o_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)
Expand Down
4 changes: 2 additions & 2 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,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 b69ab33

Please sign in to comment.