From f3ca0c8df023ac7281317ea77c2c6b08e0393067 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 4 Jun 2018 18:43:21 -0600 Subject: [PATCH] fixes to get mom cap working with cice --- config_src/nuopc_driver/mom_cap.F90 | 32 ++- config_src/nuopc_driver/mom_cap_methods.F90 | 260 +++++++++++++------- 2 files changed, 184 insertions(+), 108 deletions(-) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index e6939af64c..c24bb1261b 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -399,14 +399,10 @@ module mom_cap_mod use shr_nuopc_methods_mod, only: shr_nuopc_methods_State_SetScalar use shr_nuopc_methods_mod, only: shr_nuopc_methods_State_GetScalar use shr_nuopc_methods_mod, only: shr_nuopc_methods_State_Diagnose +#endif use MOM_ocean_model, only: ocean_model_restart, ocean_public_type, ocean_state_type - use MOM_ocean_model, only: ocean_model_data_get + use MOM_ocean_model, only: ocean_model_data_get, ocean_model_init_sfc use MOM_ocean_model, only: ocean_model_init , update_ocean_model, ocean_model_end, get_ocean_grid -#else - use ocean_model_mod, only: ocean_model_restart, ocean_public_type, ocean_state_type - use ocean_model_mod, only: ocean_model_data_get - use ocean_model_mod, only: ocean_model_init , update_ocean_model, ocean_model_end, get_ocean_grid -#endif use ESMF use NUOPC @@ -742,10 +738,14 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) ocean_public%is_ocean_pe = .true. call ocean_model_init(ocean_public, ocean_state, Time, Time) -!tcx tcraig This results in errors in CESM with help from Alper -! FATAL error "MPP_OPEN: error in OPEN for data_table" -! The subroutine data_override_init shouldn't be called because ALLOW_FLUX_ADJUSTMENTS is set to FALSE -!tcx call data_override_init(ocean_domain_in = ocean_public%domain) +#ifdef CESMCOUPLED + call ocean_model_init_sfc(ocean_state, ocean_public) +#endif + + !tcx tcraig This results in errors in CESM with help from Alper + ! FATAL error "MPP_OPEN: error in OPEN for data_table" + ! The subroutine data_override_init shouldn't be called because ALLOW_FLUX_ADJUSTMENTS is set to FALSE + !tcx call data_override_init(ocean_domain_in = ocean_public%domain) call mpp_get_compute_domain(ocean_public%domain, isc, iec, jsc, jec) call IOB_allocate(ice_ocean_boundary, isc, iec, jsc, jec) @@ -792,7 +792,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call MOM_FieldsSetup(ice_ocean_boundary, ocean_public) call MOM_AdvertiseFields(importState, fldsToOcn_num, fldsToOcn, rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_file_u)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, & + file=__FILE__)) & + return ! bail out call MOM_AdvertiseFields(exportState, fldsFrOcn_num, fldsFrOcn, rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & @@ -1403,14 +1406,10 @@ subroutine DataInitialize(gcomp, rc) return ! bail out Ice_ocean_boundary => ocean_internalstate%ptr%ice_ocean_boundary_type_ptr - ocean_public => ocean_internalstate%ptr%ocean_public_type_ptr + ocean_public => ocean_internalstate%ptr%ocean_public_type_ptr ocean_state => ocean_internalstate%ptr%ocean_state_type_ptr call get_ocean_grid(ocean_state, ocean_grid) - !tcx ---------- - RETURN - !tcx ---------- - call ocn_export(ocean_public, ocean_grid, exportState, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & @@ -2432,5 +2431,4 @@ subroutine calculate_rot_angle(OS, OSFC) #endif #endif - end module mom_cap_mod diff --git a/config_src/nuopc_driver/mom_cap_methods.F90 b/config_src/nuopc_driver/mom_cap_methods.F90 index 92c37f0e56..4743395938 100644 --- a/config_src/nuopc_driver/mom_cap_methods.F90 +++ b/config_src/nuopc_driver/mom_cap_methods.F90 @@ -1,6 +1,6 @@ -!> This is the main driver for MOM6 in CIME module mom_cap_methods + ! This is the main driver for MOM6 in CIME ! This file is part of MOM6. See LICENSE.md for the license. ! mct modules @@ -57,6 +57,7 @@ subroutine ocn_export(ocean_public, grid, exportState, rc) real(ESMF_KIND_R8), pointer :: dataPtr_fco2_ocn(:,:) real(ESMF_KIND_R8), pointer :: dataPtr_fdms_ocn(:,:) character(len=*), parameter :: subname = '(ocn_export)' + logical :: first_time = .true. !----------------------------------------------------------------------- rc = ESMF_SUCCESS @@ -140,67 +141,88 @@ subroutine ocn_export(ocean_public, grid, exportState, rc) call mpp_get_compute_domain(ocean_public%domain, isc, iec, jsc, jec) !tcx - ! write(tmpstr,'(a,6i8)') subname//'tcx1',lbnd1,ubnd1,lbnd2,ubnd2 - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx2',isc,iec,jsc,jec - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx3',lbound(ssh,1),ubound(ssh,1),lbound(ssh,2),ubound(ssh,2) - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx4',lbound(ocean_public%sea_lev,1),ubound(ocean_public%sea_lev,1),lbound(ocean_public%sea_lev,2),ubound(ocean_public%sea_lev,2) - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx5',lbound(grid%mask2dT,1),ubound(grid%mask2dT,1),lbound(grid%mask2dT,2),ubound(grid%mask2dT,2) - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx6',grid%isd,grid%ied,grid%jsd,grid%jed - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx7',grid%isc,grid%iec,grid%jsc,grid%jec - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx8',grid%idg_offset, grid%jdg_offset - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - ! write(tmpstr,'(a,6i8)') subname//'tcx9',lbound(dataPtr_omask,1),ubound(dataPtr_omask,1),lbound(dataPtr_omask,2),ubound(dataPtr_omask,2) - ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) - - ! Copy from ocean_public to exportstate. ocean_public uses global indexing with no halos. - ! The mask comes from "grid" that uses the usual MOM domain that has halos - ! and does not use global indexing. + ! write(tmpstr,'(a,6i8)') subname//'tcx1',lbnd1,ubnd1,lbnd2,ubnd2 + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx2',isc,iec,jsc,jec + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx3_1',lbound(ssh,1),ubound(ssh,1) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx3_2',lbound(ssh,2),ubound(ssh,2) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx4_1',lbound(ocean_public%sea_lev,1),ubound(ocean_public%sea_lev,1) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx4_2',lbound(ocean_public%sea_lev,2),ubound(ocean_public%sea_lev,2) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx5_1',lbound(grid%mask2dT,1),ubound(grid%mask2dT,1) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx5_2',lbound(grid%mask2dT,2),ubound(grid%mask2dT,2) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx6',grid%isd,grid%ied,grid%jsd,grid%jed + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx7',grid%isc,grid%iec,grid%jsc,grid%jec + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx8',grid%idg_offset, grid%jdg_offset + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx9_1',lbound(dataPtr_omask,1),ubound(dataPtr_omask,1) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + ! write(tmpstr,'(a,6i8)') subname//'tcx9_2',lbound(dataPtr_omask,2),ubound(dataPtr_omask,2) + ! call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO, rc=dbrc) + !tcx + + !Copy from ocean_public to exportstate. ocean_public uses global indexing with no halos. + !The mask comes from "grid" that uses the usual MOM domain that has halos + !and does not use global indexing. do j = jsc, jec j1 = j + lbnd2 - jsc jg = j + grid%jsc - jsc do i = isc, iec i1 = i + lbnd1 - isc - ig = i + grid%jsc - isc - ! surface temperature in Kelvin + ig = i + grid%isc - isc dataPtr_omask(i1,j1) = grid%mask2dT(ig,jg) - dataPtr_t(i1,j1) = ocean_public%t_surf(i,j) * grid%mask2dT(ig,jg) - dataPtr_s(i1,j1) = ocean_public%s_surf(i,j) * grid%mask2dT(ig,jg) - dataPtr_u(i1,j1) = ocean_public%u_surf(i,j) * grid%mask2dT(ig,jg) - dataPtr_v(i1,j1) = ocean_public%v_surf(i,j) * grid%mask2dT(ig,jg) - ! dataPtr_u(i1,j1) = (grid%cos_rot(ig,jg) * ocean_public%u_surf(i,j) & - ! - grid%sin_rot(ig,jg) * ocean_public%v_surf(i,j)) * grid%mask2dT(ig,jg) - ! dataPtr_v(i1,j1) = (grid%cos_rot(ig,jg) * ocean_public%v_surf(i,j) & - ! + grid%sin_rot(ig,jg) * ocean_public%u_surf(i,j)) * grid%mask2dT(ig,jg) - ! Make a copy of ssh in order to do a halo update. We use the usual MOM domain - ! in order to update halos. i.e. does not use global indexing. - ! ssh(i,j) = ocean_public%sea_lev(i,j) - ssh = 0. + dataPtr_t(i1,j1) = ocean_public%t_surf(i,j) * grid%mask2dT(ig,jg) ! surface temp is in K + dataPtr_s(i1,j1) = ocean_public%s_surf(i,j) * grid%mask2dT(ig,jg) + dataPtr_u(i1,j1) = ocean_public%u_surf(i,j) * grid%mask2dT(ig,jg) + dataPtr_v(i1,j1) = ocean_public%v_surf(i,j) * grid%mask2dT(ig,jg) + dataPtr_q(i1,j1) = 0. + !dataPtr_u(i1,j1) = (grid%cos_rot(ig,jg) * ocean_public%u_surf(i,j) & + ! - grid%sin_rot(ig,jg) * ocean_public%v_surf(i,j)) * grid%mask2dT(ig,jg) + !dataPtr_v(i1,j1) = (grid%cos_rot(ig,jg) * ocean_public%v_surf(i,j) & + ! + grid%sin_rot(ig,jg) * ocean_public%u_surf(i,j)) * grid%mask2dT(ig,jg) + end do + end do + + !dataPtr_dhdx(:,:) = 0. + !dataPtr_dhdy(:,:) = 0. + !ssh(:,:) = 0. + + ! Make a copy of ssh in order to do a halo update. We use the usual MOM domain + ! in order to update halos. i.e. does not use global indexing. + do j=grid%jsc, grid%jec + jg = j + grid%jdg_offset + do i=grid%isc,grid%iec + ig = i + grid%idg_offset + ssh(i,j) = ocean_public%sea_lev(ig,jg) end do end do -#if (1 == 0) ! Update halo of ssh so we can calculate gradients call pass_var(ssh, grid%domain) ! d/dx ssh - do j=jsc, jec - j1 = j + lbnd2 - jsc - do i=isc,iec - i1 = i + lbnd1 - isc + do jg = jsc, jec + j = jg + grid%jsc - jsc + j1 = jg + lbnd2 - jsc + do ig = isc,iec + i = ig + grid%isc - isc + i1 = ig + lbnd1 - isc + ! This is a simple second-order difference !dataPtr_dhdx(i1,j1) = 0.5 * (ssh(i+1,j) - ssh(i-1,j)) * grid%IdxT(i,j) * grid%mask2dT(ig,jg) ! This is a PLM slope which might be less prone to the A-grid null mode - slp_L = (ssh(I,j) - ssh(I-1,j)) * grid%mask2dCu(I-1,j) - if (grid%mask2dCu(I-1,j)==0.) slp_L = 0. - slp_R = (ssh(I+1,j) - ssh(I,j)) * grid%mask2dCu(I,j) - if (grid%mask2dCu(I+1,j)==0.) slp_R = 0. + slp_L = (ssh(I,j) - ssh(I-1,j)) * grid%mask2dCu(i-1,j) + if (grid%mask2dCu(i-1,j)==0.) slp_L = 0. + slp_R = (ssh(I+1,j) - ssh(I,j)) * grid%mask2dCu(i,j) + if (grid%mask2dCu(i+1,j)==0.) slp_R = 0. slp_C = 0.5 * (slp_L + slp_R) if ( (slp_L * slp_R) > 0.0 ) then ! This limits the slope so that the edge values are bounded by the @@ -213,23 +235,26 @@ subroutine ocn_export(ocean_public, grid, exportState, rc) ! larger extreme values. slope = 0.0 end if - dataPtr_dhdx(i1,j1) = slope * grid%IdxT(i,j) * grid%mask2dT(ig,jg) - if (grid%mask2dT(ig,jg)==0.) dataPtr_dhdx(i1,j1) = 0.0 + dataPtr_dhdx(i1,j1) = slope * grid%IdxT(i,j) * grid%mask2dT(i,j) + if (grid%mask2dT(i,j)==0.) dataPtr_dhdx(i1,j1) = 0.0 end do end do ! d/dy ssh - do j=jsc, jec - j1 = j + lbnd2 - jsc - do i=isc,iec - i1 = i + lbnd1 - isc + do jg = jsc, jec + j = jg + grid%jsc - jsc + j1 = jg + lbnd2 - jsc + do ig = isc,iec + i = ig + grid%isc - isc + i1 = ig + lbnd1 - isc + ! This is a simple second-order difference !dataPtr_dhdy(i1,j1) = 0.5 * (ssh(i,j+1) - ssh(i,j-1)) * grid%IdyT(i,j) * grid%mask2dT(ig,jg) ! This is a PLM slope which might be less prone to the A-grid null mode - slp_L = ssh(i,J) - ssh(i,J-1) * grid%mask2dCv(i,J-1) - if (grid%mask2dCv(i,J-1)==0.) slp_L = 0. - slp_R = ssh(i,J+1) - ssh(i,J) * grid%mask2dCv(i,J) - if (grid%mask2dCv(i,J+1)==0.) slp_R = 0. + slp_L = ssh(i,J) - ssh(i,J-1) * grid%mask2dCv(i,j-1) + if (grid%mask2dCv(i,j-1)==0.) slp_L = 0. + slp_R = ssh(i,J+1) - ssh(i,J) * grid%mask2dCv(i,j) + if (grid%mask2dCv(i,j+1)==0.) slp_R = 0. slp_C = 0.5 * (slp_L + slp_R) !write(6,*)'slp_L, slp_R,i,j,slp_L*slp_R', slp_L, slp_R,i,j,slp_L*slp_R if ((slp_L * slp_R) > 0.0) then @@ -243,11 +268,76 @@ subroutine ocn_export(ocean_public, grid, exportState, rc) ! larger extreme values. slope = 0.0 end if - dataPtr_dhdy(i1,j1) = slope * grid%IdyT(i,j) * grid%mask2dT(ig,jg) - if (grid%mask2dT(ig,jg)==0.) dataPtr_dhdy(i1,j1) = 0.0 + dataPtr_dhdy(i1,j1) = slope * grid%IdyT(i,j) * grid%mask2dT(i,j) + if (grid%mask2dT(i,j)==0.) dataPtr_dhdy(i1,j1) = 0.0 end do end do -#endif + +!!$ ! Update halo of ssh so we can calculate gradients +!!$ call pass_var(ssh, grid%domain) +!!$ +!!$ ! d/dx ssh +!!$ do j=grid%jsc, grid%jec +!!$ j1 = j + lbnd2 - grid%jsc +!!$ do i=grid%isc,grid%iec +!!$ i1 = i + lbnd1 - grid%isc +!!$ ! This is a simple second-order difference +!!$ ! dataPtr_dhdx(i1,j1) = 0.5 * (ssh(i+1,j) - ssh(i-1,j)) * grid%IdxT(i,j) * grid%mask2dT(ig,jg) +!!$ ! This is a PLM slope which might be less prone to the A-grid null mode +!!$ slp_L = (ssh(i,j) - ssh(i-1,j)) * grid%mask2dCu(i-1,j) +!!$ if (grid%mask2dCu(i-1,j)==0.) slp_L = 0. +!!$ +!!$ slp_R = (ssh(i+1,j) - ssh(i,j)) * grid%mask2dCu(i,j) +!!$ if (grid%mask2dCu(i+1,j)==0.) slp_R = 0. +!!$ +!!$ slp_C = 0.5 * (slp_L + slp_R) +!!$ if ( (slp_L * slp_R) > 0.0 ) then +!!$ ! This limits the slope so that the edge values are bounded by the +!!$ ! two cell averages spanning the edge. +!!$ u_min = min( ssh(i-1,j), ssh(i,j), ssh(i+1,j) ) +!!$ u_max = max( ssh(i-1,j), ssh(i,j), ssh(i+1,j) ) +!!$ slope = sign( min( abs(slp_C), 2.*min( ssh(i,j) - u_min, u_max - ssh(i,j) ) ), slp_C ) +!!$ else +!!$ ! Extrema in the mean values require a PCM reconstruction avoid generating +!!$ ! larger extreme values. +!!$ slope = 0.0 +!!$ end if +!!$ dataPtr_dhdx(i1,j1) = slope * grid%IdxT(i,j) * grid%mask2dT(ig,jg) +!!$ if (grid%mask2dT(ig,jg)==0.) dataPtr_dhdx(i1,j1) = 0.0 +!!$ end do +!!$ end do +!!$ +!!$ ! d/dy ssh +!!$ do j=grid%jsc, grid%jec +!!$ j1 = j + lbnd2 - grid%jsc +!!$ do i=grid%isc,grid%iec +!!$ i1 = i + lbnd1 - grid%isc +!!$ ! This is a simple second-order difference +!!$ ! dataPtr_dhdy(i1,j1) = 0.5 * (ssh(i,j+1) - ssh(i,j-1)) * grid%IdyT(i,j) * grid%mask2dT(ig,jg) +!!$ ! This is a PLM slope which might be less prone to the A-grid null mode +!!$ slp_L = ssh(i,j) - ssh(i,j-1) * grid%mask2dCv(i,j-1) +!!$ if (grid%mask2dCv(i,j-1)==0.) slp_L = 0. +!!$ +!!$ slp_R = ssh(i,j+1) - ssh(i,j) * grid%mask2dCv(i,j) +!!$ if (grid%mask2dCv(i,j+1)==0.) slp_R = 0. +!!$ +!!$ slp_C = 0.5 * (slp_L + slp_R) +!!$ if ((slp_L * slp_R) > 0.0) then +!!$ ! This limits the slope so that the edge values are bounded by the +!!$ ! two cell averages spanning the edge. +!!$ u_min = min( ssh(i,j-1), ssh(i,j), ssh(i,j+1) ) +!!$ u_max = max( ssh(i,j-1), ssh(i,j), ssh(i,j+1) ) +!!$ slope = sign( min( abs(slp_C), 2.*min( ssh(i,j) - u_min, u_max - ssh(i,j) ) ), slp_C ) +!!$ else +!!$ ! Extrema in the mean values require a PCM reconstruction avoid generating +!!$ ! larger extreme values. +!!$ slope = 0.0 +!!$ end if +!!$ dataPtr_dhdy(i1,j1) = slope * grid%IdyT(i,j) * grid%mask2dT(ig,jg) +!!$ if (grid%mask2dT(ig,jg)==0.) dataPtr_dhdy(i1,j1) = 0.0 +!!$ end do +!!$ end do + end subroutine ocn_export !----------------------------------------------------------------------- @@ -506,38 +596,26 @@ subroutine ocn_import(ocean_public, grid, importState, ice_ocean_boundary, rc) ! This will skip the first time import information is given if (import_cnt > 2) then - ! ice_ocean_boundary%p(i,j) = GRID%mask2dT(ig,jg) * dataPtr_p(i1,j1) - ice_ocean_boundary%u_flux(i,j) = dataPtr_taux(i1,j1) * GRID%mask2dT(ig,jg) - ice_ocean_boundary%v_flux(i,j) = dataPtr_tauy(i1,j1) * GRID%mask2dT(ig,jg) - ! ice_ocean_boundary%u_flux(i,j) = (GRID%cos_rot(ig,jg)*dataPtr_taux(i1,j1) + & - ! GRID%sin_rot(ig,jg)*dataPtr_tauy(i1,j1)) - ! ice_ocean_boundary%v_flux(i,j) = (GRID%cos_rot(ig,jg)*dataPtr_tauy(i1,j1) + & - ! GRID%sin_rot(ig,jg)*dataPtr_taux(i1,j1)) - - ice_ocean_boundary%t_flux(i,j) = -dataPtr_sen(i1,j1) * GRID%mask2dT(ig,jg) - ice_ocean_boundary%q_flux(i,j) = -dataPtr_evap(i1,j1) * GRID%mask2dT(ig,jg) - !! ice_ocean_boundary%latent(i,j) = dataPtr_lat(i1,j1) * GRID%mask2dT(ig,jg) - ice_ocean_boundary%lw_flux(i,j) = (dataPtr_lwup(i1,j1) + dataPtr_lwdn(i1,j1)) * GRID%mask2dT(ig,jg) - - ! tcx TO DO c1-c4 - ! c1 = 0.25_ESMF_KIND_R8 - ! c2 = 0.25_ESMF_KIND_R8 - ! c3 = 0.25_ESMF_KIND_R8 - ! c4 = 0.25_ESMF_KIND_R8 - ice_ocean_boundary%sw_flux_vis_dir(i,j) = GRID%mask2dT(ig,jg) * dataPtr_swvdr(i1,j1) - ice_ocean_boundary%sw_flux_vis_dif(i,j) = GRID%mask2dT(ig,jg) * dataPtr_swvdf(i1,j1) - ice_ocean_boundary%sw_flux_nir_dir(i,j) = GRID%mask2dT(ig,jg) * dataPtr_swndf(i1,j1) - ice_ocean_boundary%sw_flux_nir_dif(i,j) = GRID%mask2dT(ig,jg) * dataPtr_swndf(i1,j1) - - ! ice_ocean_boundary%sw(i,j) = ice_ocean_boundary%sw_flux_vis_dir(i,j) + ice_ocean_boundary%sw_flux_vis_dif(i,j) + & - ! ice_ocean_boundary%sw_flux_nir_dir(i,j) + ice_ocean_boundary%sw_flux_nir_dif(i,j) - - ice_ocean_boundary%lprec(i,j) = dataPtr_rain(i1,j1) * GRID%mask2dT(ig,jg) - ice_ocean_boundary%fprec(i,j) = dataPtr_snow(i1,j1) * GRID%mask2dT(ig,jg) - ! ice_ocean_boundary%runoff(i,j) = (dataPtr_rofl(i1,j1)+dataPtr_rofi(i1,j1)) * GRID%mask2dT(ig,jg) - - ! ice_ocean_boundary%salt_flux(i,j) = GRID%mask2dT(ig,jg)*dataPtr_iosalt(i1,j1) - ! ice_ocean_boundary%salt_flux(i,j) = GRID%mask2dT(ig,jg)*(dataPtr_osalt(i1,j1) + ice_ocean_boundary%salt_flux(i,j)) + ice_ocean_boundary%p(i,j) = dataPtr_p(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%u_flux(i,j) = dataPtr_taux(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%v_flux(i,j) = dataPtr_tauy(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%lprec(i,j) = dataPtr_rain(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%fprec(i,j) = dataPtr_snow(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%t_flux(i,j) = -dataPtr_sen(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%q_flux(i,j) = -dataPtr_evap(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%lw_flux(i,j) = (dataPtr_lwup(i1,j1) + dataPtr_lwdn(i1,j1)) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%sw_flux_vis_dir(i,j) = dataPtr_swvdr(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%sw_flux_vis_dif(i,j) = dataPtr_swvdf(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%sw_flux_nir_dir(i,j) = dataPtr_swndf(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%sw_flux_nir_dif(i,j) = dataPtr_swndf(i1,j1) * GRID%mask2dT(ig,jg) + ice_ocean_boundary%salt_flux(i,j) = dataPtr_iosalt(i1,j1) * GRID%mask2dT(ig,jg) + !ice_ocean_boundary%salt_flux(i,j) = (dataPtr_osalt(i1,j1) + ice_ocean_boundary%salt_flux(i,j)) * GRID%mask2dT(ig,jg) + !ice_ocean_boundary%latent_flux(i,j) = dataPtr_lat(i1,j1) * GRID%mask2dT(ig,jg) + !ice_ocean_boundary%runoff(i,j) = (dataPtr_rofl(i1,j1)+dataPtr_rofi(i1,j1)) * GRID%mask2dT(ig,jg) + !ice_ocean_boundary%u_flux(i,j) = (GRID%cos_rot(ig,jg)*dataPtr_taux(i1,j1) + & + ! GRID%sin_rot(ig,jg)*dataPtr_tauy(i1,j1)) + !ice_ocean_boundary%v_flux(i,j) = (GRID%cos_rot(ig,jg)*dataPtr_tauy(i1,j1) + & + ! GRID%sin_rot(ig,jg)*dataPtr_taux(i1,j1)) endif