Skip to content

Commit

Permalink
Enable the export of ice fraction when wave coupling is on.
Browse files Browse the repository at this point in the history
The export of ice fraction was previously added for the
newly added CFC module.
  • Loading branch information
alperaltuntas committed Jul 9, 2021
1 parent bc65e4f commit 5f756ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
endif

if (OS%use_waves) then
call allocate_forcing_type(OS%grid, OS%fluxes, waves=.true.)
call get_param(param_file, mdl, "WAVE_METHOD", OS%wave_method, default="EMPTY", do_not_log=.true.)
call MOM_wave_interface_init(OS%Time, OS%grid, OS%GV, OS%US, param_file, OS%Waves, OS%diag)
if (OS%wave_method == "VR12-MA") then
Expand Down
18 changes: 7 additions & 11 deletions config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -545,18 +545,14 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
fluxes%sw(i,j) = fluxes%sw_vis_dir(i,j) + fluxes%sw_vis_dif(i,j) + &
fluxes%sw_nir_dir(i,j) + fluxes%sw_nir_dif(i,j)

enddo ; enddo
! sea ice fraction [nondim]
if (associated(IOB%ice_fraction) .and. associated(fluxes%ice_fraction)) &
fluxes%ice_fraction(i,j) = G%mask2dT(i,j) * IOB%ice_fraction(i-i0,j-j0)
! 10-m wind speed squared [m2/s2]
if (associated(IOB%u10_sqr) .and. associated(fluxes%u10_sqr)) &
fluxes%u10_sqr(i,j) = US%m_to_L**2 * US%T_to_s**2 * G%mask2dT(i,j) * IOB%u10_sqr(i-i0,j-j0)

if (CS%use_CFC) then
do j=js,je ; do i=is,ie
! sea ice fraction [nondim]
if (associated(IOB%ice_fraction)) &
fluxes%ice_fraction(i,j) = G%mask2dT(i,j) * IOB%ice_fraction(i-i0,j-j0)
! 10-m wind speed squared [m2/s2]
if (associated(IOB%u10_sqr)) &
fluxes%u10_sqr(i,j) = US%m_to_L**2 * US%T_to_s**2 * G%mask2dT(i,j) * IOB%u10_sqr(i-i0,j-j0)
enddo ; enddo
endif
enddo ; enddo

! applied surface pressure from atmosphere and cryosphere
if (associated(IOB%p)) then
Expand Down
6 changes: 5 additions & 1 deletion src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,7 @@ end subroutine forcing_diagnostics

!> Conditionally allocate fields within the forcing type
subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
shelf, iceberg, salt, fix_accum_bug, cfc)
shelf, iceberg, salt, fix_accum_bug, cfc, waves)
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
type(forcing), intent(inout) :: fluxes !< A structure containing thermodynamic forcing fields
logical, optional, intent(in) :: water !< If present and true, allocate water fluxes
Expand All @@ -2961,6 +2961,7 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
logical, optional, intent(in) :: fix_accum_bug !< If present and true, avoid using a bug in
!! accumulation of ustar_gustless
logical, optional, intent(in) :: cfc !< If present and true, allocate cfc fluxes
logical, optional, intent(in) :: waves !< If present and true, allocate wave fields

! Local variables
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
Expand Down Expand Up @@ -3022,6 +3023,9 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
call myAlloc(fluxes%ice_fraction,isd,ied,jsd,jed, cfc)
call myAlloc(fluxes%u10_sqr,isd,ied,jsd,jed, cfc)

!These fields should only on allocated when wave coupling is activated.
call myAlloc(fluxes%ice_fraction,isd,ied,jsd,jed, waves)

if (present(fix_accum_bug)) fluxes%gustless_accum_bug = .not.fix_accum_bug
end subroutine allocate_forcing_by_group

Expand Down

0 comments on commit 5f756ab

Please sign in to comment.