Skip to content

Commit

Permalink
(1/2) Add separate fluxes for glc runoff. (2/2) Add heat content fiel…
Browse files Browse the repository at this point in the history
…ds for lrunoff_glc and frunoff_glc.
  • Loading branch information
alperaltuntas committed Jul 27, 2024
1 parent 7fe4ee4 commit 6b3720c
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 54 deletions.
24 changes: 23 additions & 1 deletion config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
Ice_ocean_boundary% hevap (isc:iec,jsc:jec), &
Ice_ocean_boundary% hcond (isc:iec,jsc:jec), &
Ice_ocean_boundary% lrunoff_glc (isc:iec,jsc:jec), &
Ice_ocean_boundary% frunoff_glc (isc:iec,jsc:jec))
Ice_ocean_boundary% frunoff_glc (isc:iec,jsc:jec), &
Ice_ocean_boundary% hrofl_glc (isc:iec,jsc:jec), &
Ice_ocean_boundary% hrofi_glc (isc:iec,jsc:jec))

Ice_ocean_boundary%hrain = 0.0
Ice_ocean_boundary%hsnow = 0.0
Expand All @@ -723,6 +725,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
Ice_ocean_boundary%hcond = 0.0
Ice_ocean_boundary%lrunoff_glc = 0.0
Ice_ocean_boundary%frunoff_glc = 0.0
Ice_ocean_boundary%hrofl_glc = 0.0
Ice_ocean_boundary%hrofi_glc = 0.0
endif

call query_ocean_state(ocean_state, use_waves=use_waves, wave_method=wave_method)
Expand Down Expand Up @@ -783,6 +787,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_hcond" , "will provide")
call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_hrofl" , "will provide")
call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_hrofi" , "will provide")
if (cesm_coupled) then
call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_hrofl_glc" , "will provide")
call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_hrofi_glc" , "will provide")
endif

if (use_waves) then
if (wave_method == "EFACTOR") then
Expand Down Expand Up @@ -2789,6 +2797,20 @@ end subroutine shr_log_setLogUnit
!! <td></td>
!! </tr>
!! <tr>
!! <td>Foxx_hrofi_glc</td>
!! <td>W m-2</td>
!! <td>hrofi_glc</td>
!! <td>heat content (enthalpy) of frozen glc runoff</td>
!! <td></td>
!! </tr>
!! <tr>
!! <td>Foxx_hrofl_glc</td>
!! <td>W m-2</td>
!! <td>hrofl_glc</td>
!! <td>heat content (enthalpy) of liquid glc runoff</td>
!! <td></td>
!! </tr>
!! <tr>
!! <td>Fioi_salt</td>
!! <td>kg m-2 s-1</td>
!! <td>salt_flux</td>
Expand Down
17 changes: 17 additions & 0 deletions config_src/drivers/nuopc_cap/mom_cap_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,23 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary,
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

!----
! enthalpy from liquid glc runoff (hrofl_glc)
!----
if ( associated(ice_ocean_boundary%hrofl_glc) ) then
call state_getimport(importState, 'Foxx_hrofl_glc', isc, iec, jsc, jec, &
ice_ocean_boundary%hrofl_glc, areacor=med2mod_areacor, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

!----
! enthalpy from frozen glc runoff (hrofi_glc)
!----
if ( associated(ice_ocean_boundary%hrofi_glc) ) then
call state_getimport(importState, 'Foxx_hrofi_glc', isc, iec, jsc, jec, &
ice_ocean_boundary%hrofi_glc, areacor=med2mod_areacor, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
!----
! enthalpy from evaporation (hevap)
!----
Expand Down
22 changes: 19 additions & 3 deletions config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ module MOM_surface_forcing_nuopc
real, pointer, dimension(:,:) :: mass_berg =>NULL() !< mass of icebergs(kg/m2)
real, pointer, dimension(:,:) :: hrofl =>NULL() !< heat content from liquid runoff [W/m2]
real, pointer, dimension(:,:) :: hrofi =>NULL() !< heat content from frozen runoff [W/m2]
real, pointer, dimension(:,:) :: hrofl_glc =>NULL() !< heat content from liquid glc runoff [W/m2]
real, pointer, dimension(:,:) :: hrofi_glc =>NULL() !< heat content from frozen glc runoff [W/m2]
real, pointer, dimension(:,:) :: hrain =>NULL() !< heat content from liquid precipitation [W/m2]
real, pointer, dimension(:,:) :: hsnow =>NULL() !< heat content from frozen precipitation [W/m2]
real, pointer, dimension(:,:) :: hevap =>NULL() !< heat content from evaporation [W/m2]
Expand Down Expand Up @@ -476,12 +478,12 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,

! add liquid glc runoff flux via rof
if (associated(IOB%lrunoff_glc)) then
fluxes%lrunoff(i,j) = fluxes%lrunoff(i,j) + kg_m2_s_conversion * IOB%lrunoff_glc(i-i0,j-j0) * G%mask2dT(i,j)
fluxes%lrunoff_glc(i,j) = kg_m2_s_conversion * IOB%lrunoff_glc(i-i0,j-j0) * G%mask2dT(i,j)
endif

! ice glc runoff flux via rof
if (associated(IOB%frunoff_glc)) then
fluxes%frunoff(i,j) = fluxes%frunoff(i,j) + kg_m2_s_conversion * IOB%frunoff_glc(i-i0,j-j0) * G%mask2dT(i,j)
fluxes%frunoff_glc(i,j) = kg_m2_s_conversion * IOB%frunoff_glc(i-i0,j-j0) * G%mask2dT(i,j)
endif

if (associated(IOB%ustar_berg)) &
Expand Down Expand Up @@ -525,6 +527,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
if (associated(IOB%frunoff_glc)) then
fluxes%latent(i,j) = fluxes%latent(i,j) - &
IOB%frunoff_glc(i-i0,j-j0) * US%W_m2_to_QRZ_T * CS%latent_heat_fusion
! todo: confirm below subtraction of frunoff_glc to latent_frunoff_diag is correct.
fluxes%latent_frunoff_diag(i,j) = fluxes%latent_frunoff_diag(i,j) - G%mask2dT(i,j) * &
IOB%frunoff_glc(i-i0,j-j0) * US%W_m2_to_QRZ_T * CS%latent_heat_fusion
endif
Expand Down Expand Up @@ -569,6 +572,12 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,

if (associated(IOB%hcond)) &
fluxes%heat_content_cond(i,j) = US%W_m2_to_QRZ_T * IOB%hcond(i-i0,j-j0) * G%mask2dT(i,j)

if (associated(IOB%hrofl_glc)) &
fluxes%heat_content_lrunoff_glc(i,j) = US%W_m2_to_QRZ_T * IOB%hrofl_glc(i-i0,j-j0) * G%mask2dT(i,j)

if (associated(IOB%hrofi_glc)) &
fluxes%heat_content_frunoff_glc(i,j) = US%W_m2_to_QRZ_T * IOB%hrofi_glc(i-i0,j-j0) * G%mask2dT(i,j)
endif

! sea ice fraction [nondim]
Expand Down Expand Up @@ -622,7 +631,8 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
do j=js,je ; do i=is,ie
net_FW(i,j) = US%RZ_T_to_kg_m2s * &
(((fluxes%lprec(i,j) + fluxes%fprec(i,j) + fluxes%seaice_melt(i,j)) + &
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j))) + &
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j) + &
fluxes%lrunoff_glc(i,j) + fluxes%frunoff_glc(i,j))) + &
(fluxes%evap(i,j) + fluxes%vprec(i,j)) ) * US%L_to_m**2*G%areaT(i,j)
net_FW2(i,j) = net_FW(i,j) / (US%L_to_m**2*G%areaT(i,j))
enddo ; enddo
Expand Down Expand Up @@ -1536,6 +1546,12 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt)
if (associated(iobt%hcond)) then
chks = field_chksum( iobt%hcond ) ; if (root) write(outunit,100) 'iobt%hcond ', chks
endif
if (associated(iobt%hrofl_glc)) then
chks = field_chksum( iobt%hrofl_glc ) ; if (root) write(outunit,100) 'iobt%hrofl_glc ', chks
endif
if (associated(iobt%hrofl_glc)) then
chks = field_chksum( iobt%hrofl_glc ) ; if (root) write(outunit,100) 'iobt%hrofl_glc ', chks
endif

100 FORMAT(" CHECKSUM::",A20," = ",Z20)

Expand Down
Loading

0 comments on commit 6b3720c

Please sign in to comment.