Skip to content

Commit 202ff90

Browse files
author
Henri Drake
committed
Pass seaice_melt through all ice-ocean couplers
Some other minor bug fixes
1 parent b3e65c6 commit 202ff90

12 files changed

+71
-64
lines changed

config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,7 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt)
17961796
chks = field_chksum( iobt%sw_flux_nir_dif) ; if (root) write(outunit,100) 'iobt%sw_flux_nir_dif', chks
17971797
chks = field_chksum( iobt%lprec ) ; if (root) write(outunit,100) 'iobt%lprec ', chks
17981798
chks = field_chksum( iobt%fprec ) ; if (root) write(outunit,100) 'iobt%fprec ', chks
1799+
! hfd/Gives error: "Program received signal SIGSEGV: Segmentation fault - invalid memory reference."
17991800
chks = field_chksum( iobt%seaice_melt ) ; if (root) write(outunit,100) 'iobt%seaice_melt ', chks
18001801
chks = field_chksum( iobt%runoff ) ; if (root) write(outunit,100) 'iobt%runoff ', chks
18011802
chks = field_chksum( iobt%calving ) ; if (root) write(outunit,100) 'iobt%calving ', chks

config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ module MOM_surface_forcing_mct
156156
real, pointer, dimension(:,:) :: q_flux =>NULL() !< specific humidity flux [kg/m2/s]
157157
real, pointer, dimension(:,:) :: salt_flux =>NULL() !< salt flux [kg/m2/s]
158158
real, pointer, dimension(:,:) :: seaice_melt_heat =>NULL() !< sea ice and snow melt heat flux [W/m2]
159-
real, pointer, dimension(:,:) :: seaice_melt =>NULL() !< water flux due to sea ice and snow melting [kg/m2/s]
160159
real, pointer, dimension(:,:) :: lw_flux =>NULL() !< long wave radiation [W/m2]
161160
real, pointer, dimension(:,:) :: sw_flux_vis_dir =>NULL() !< direct visible sw radiation [W/m2]
162161
real, pointer, dimension(:,:) :: sw_flux_vis_dif =>NULL() !< diffuse visible sw radiation [W/m2]
163162
real, pointer, dimension(:,:) :: sw_flux_nir_dir =>NULL() !< direct Near InfraRed sw radiation [W/m2]
164163
real, pointer, dimension(:,:) :: sw_flux_nir_dif =>NULL() !< diffuse Near InfraRed sw radiation [W/m2]
165164
real, pointer, dimension(:,:) :: lprec =>NULL() !< mass flux of liquid precip [kg/m2/s]
166165
real, pointer, dimension(:,:) :: fprec =>NULL() !< mass flux of frozen precip [kg/m2/s]
166+
real, pointer, dimension(:,:) :: seaice_melt =>NULL() !< water flux due to sea ice and snow melting [kg/m2/s]
167167
real, pointer, dimension(:,:) :: runoff =>NULL() !< mass flux of liquid runoff [kg/m2/s]
168168
real, pointer, dimension(:,:) :: calving =>NULL() !< mass flux of frozen runoff [kg/m2/s]
169169
real, pointer, dimension(:,:) :: ustar_berg =>NULL() !< frictional velocity beneath icebergs [m/s]
@@ -428,6 +428,10 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
428428
if (associated(IOB%fprec)) &
429429
fluxes%fprec(i,j) = kg_m2_s_conversion * IOB%fprec(i-i0,j-j0) * G%mask2dT(i,j)
430430

431+
! water flux due to sea ice and snow melt
432+
if (associated(IOB%seaice_melt)) &
433+
fluxes%seaice_melt(i,j) = kg_m2_s_conversion * IOB%seaice_melt(i-i0,j-j0) * G%mask2dT(i,j)
434+
431435
! evaporation
432436
if (associated(IOB%q_flux)) &
433437
fluxes%evap(i,j) = kg_m2_s_conversion * IOB%q_flux(i-i0,j-j0) * G%mask2dT(i,j)
@@ -477,10 +481,6 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
477481
if (associated(IOB%seaice_melt_heat)) &
478482
fluxes%seaice_melt_heat(i,j) = G%mask2dT(i,j) * US%W_m2_to_QRZ_T * IOB%seaice_melt_heat(i-i0,j-j0)
479483

480-
! water flux due to sea ice and snow melt [kg/m2/s]
481-
if (associated(IOB%seaice_melt)) &
482-
fluxes%seaice_melt(i,j) = G%mask2dT(i,j) * kg_m2_s_conversion * IOB%seaice_melt(i-i0,j-j0)
483-
484484
! latent heat flux (W/m^2)
485485
fluxes%latent(i,j) = 0.0
486486
! contribution from frozen ppt (notice minus sign since fprec is positive into the ocean)

config_src/drivers/STALE_mct_cap/ocn_cap_methods.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ subroutine ocn_import(x2o, ind, grid, ice_ocean_boundary, ocean_public, logunit,
6262
! frozen precipitation (snow)
6363
ice_ocean_boundary%fprec(i,j) = x2o(ind%x2o_Faxa_snow,k)
6464

65+
! water flux from snow&ice melt (kg/m2/s)
66+
ice_ocean_boundary%seaice_melt(i,j) = x2o(ind%x2o_Fioi_meltw,k)
67+
6568
! longwave radiation, sum up and down (W/m2)
6669
ice_ocean_boundary%lw_flux(i,j) = (x2o(ind%x2o_Faxa_lwdn,k) + x2o(ind%x2o_Foxx_lwup,k))
6770

@@ -74,9 +77,6 @@ subroutine ocn_import(x2o, ind, grid, ice_ocean_boundary, ocean_public, logunit,
7477
! snow&ice melt heat flux (W/m^2)
7578
ice_ocean_boundary%seaice_melt_heat(i,j) = x2o(ind%x2o_Fioi_melth,k)
7679

77-
! water flux from snow&ice melt (kg/m2/s)
78-
ice_ocean_boundary%seaice_melt(i,j) = x2o(ind%x2o_Fioi_meltw,k)
79-
8080
! liquid runoff
8181
ice_ocean_boundary%rofl_flux(i,j) = x2o(ind%x2o_Foxx_rofl,k) * GRID%mask2dT(i,j)
8282

config_src/drivers/STALE_mct_cap/ocn_comp_mct.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ subroutine IOB_allocate(IOB, isc, iec, jsc, jec)
858858
IOB% v_flux (isc:iec,jsc:jec), &
859859
IOB% t_flux (isc:iec,jsc:jec), &
860860
IOB% seaice_melt_heat (isc:iec,jsc:jec),&
861-
IOB% seaice_melt (isc:iec,jsc:jec), &
862861
IOB% q_flux (isc:iec,jsc:jec), &
863862
IOB% salt_flux (isc:iec,jsc:jec), &
864863
IOB% lw_flux (isc:iec,jsc:jec), &
@@ -868,6 +867,7 @@ subroutine IOB_allocate(IOB, isc, iec, jsc, jec)
868867
IOB% sw_flux_nir_dif (isc:iec,jsc:jec), &
869868
IOB% lprec (isc:iec,jsc:jec), &
870869
IOB% fprec (isc:iec,jsc:jec), &
870+
IOB% seaice_melt (isc:iec,jsc:jec), &
871871
IOB% ustar_berg (isc:iec,jsc:jec), &
872872
IOB% area_berg (isc:iec,jsc:jec), &
873873
IOB% mass_berg (isc:iec,jsc:jec), &

config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,8 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
459459
if (associated(IOB%fprec)) &
460460
fluxes%fprec(i,j) = kg_m2_s_conversion * IOB%fprec(i-i0,j-j0) * G%mask2dT(i,j)
461461

462-
! water flux due to sea ice and snow melt [kg/m2/s]
463-
if (associated(IOB%seaice_melt)) &
464-
fluxes%seaice_melt(i,j) = kg_m2_s_conversion * G%mask2dT(i,j) * IOB%seaice_melt(i-i0,j-j0)
462+
if (associated(IOB%seaice_melt)) &
463+
fluxes%seaice_melt(i,j) = kg_m2_s_conversion * IOB%seaice_melt(i-i0,j-j0) * G%mask2dT(i,j)
465464

466465
if (associated(IOB%q_flux)) &
467466
fluxes%evap(i,j) = kg_m2_s_conversion * IOB%q_flux(i-i0,j-j0) * G%mask2dT(i,j)

config_src/drivers/solo_driver/MESO_surface_forcing.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
9999
call safe_alloc_ptr(fluxes%evap, isd, ied, jsd, jed)
100100
call safe_alloc_ptr(fluxes%lprec, isd, ied, jsd, jed)
101101
call safe_alloc_ptr(fluxes%fprec, isd, ied, jsd, jed)
102+
call safe_alloc_ptr(fluxes%seaice_melt, isd, ied, jsd, jed)
102103
call safe_alloc_ptr(fluxes%lrunoff, isd, ied, jsd, jed)
103104
call safe_alloc_ptr(fluxes%frunoff, isd, ied, jsd, jed)
104105
call safe_alloc_ptr(fluxes%vprec, isd, ied, jsd, jed)
@@ -142,6 +143,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
142143
! and are positive downward - i.e. evaporation should be negative.
143144
fluxes%evap(i,j) = -0.0 * G%mask2dT(i,j)
144145
fluxes%lprec(i,j) = CS%PmE(i,j) * CS%Rho0 * G%mask2dT(i,j)
146+
fluxes%seaice_melt(i,j) = 0.0 * G%mask2dT(i,j)
145147

146148
! vprec will be set later, if it is needed for salinity restoring.
147149
fluxes%vprec(i,j) = 0.0

config_src/drivers/solo_driver/MOM_surface_forcing.F90

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,15 +1180,16 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, US, CS)
11801180
! assume solid runoff (calving) enters ocean at 0degC
11811181
! mass leaving the ocean has heat_content determined in MOM_diabatic_driver.F90
11821182
do j=js,je ; do i=is,ie
1183-
fluxes%evap(i,j) = fluxes%evap(i,j) * G%mask2dT(i,j)
1184-
fluxes%lprec(i,j) = fluxes%lprec(i,j) * G%mask2dT(i,j)
1185-
fluxes%fprec(i,j) = fluxes%fprec(i,j) * G%mask2dT(i,j)
1186-
fluxes%lrunoff(i,j) = fluxes%lrunoff(i,j) * G%mask2dT(i,j)
1187-
fluxes%frunoff(i,j) = fluxes%frunoff(i,j) * G%mask2dT(i,j)
1188-
fluxes%lw(i,j) = fluxes%lw(i,j) * G%mask2dT(i,j)
1189-
fluxes%sens(i,j) = fluxes%sens(i,j) * G%mask2dT(i,j)
1190-
fluxes%sw(i,j) = fluxes%sw(i,j) * G%mask2dT(i,j)
1191-
fluxes%latent(i,j) = fluxes%latent(i,j) * G%mask2dT(i,j)
1183+
fluxes%evap(i,j) = fluxes%evap(i,j) * G%mask2dT(i,j)
1184+
fluxes%lprec(i,j) = fluxes%lprec(i,j) * G%mask2dT(i,j)
1185+
fluxes%fprec(i,j) = fluxes%fprec(i,j) * G%mask2dT(i,j)
1186+
fluxes%seaice_melt(i,j) = fluxes%seaice_melt(i,j) * G%mask2dT(i,j)
1187+
fluxes%lrunoff(i,j) = fluxes%lrunoff(i,j) * G%mask2dT(i,j)
1188+
fluxes%frunoff(i,j) = fluxes%frunoff(i,j) * G%mask2dT(i,j)
1189+
fluxes%lw(i,j) = fluxes%lw(i,j) * G%mask2dT(i,j)
1190+
fluxes%sens(i,j) = fluxes%sens(i,j) * G%mask2dT(i,j)
1191+
fluxes%sw(i,j) = fluxes%sw(i,j) * G%mask2dT(i,j)
1192+
fluxes%latent(i,j) = fluxes%latent(i,j) * G%mask2dT(i,j)
11921193

11931194
fluxes%latent_evap_diag(i,j) = fluxes%latent_evap_diag(i,j) * G%mask2dT(i,j)
11941195
fluxes%latent_fprec_diag(i,j) = -fluxes%fprec(i,j)*CS%latent_heat_fusion
@@ -1294,10 +1295,11 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, US
12941295
fluxes%latent_evap_diag(i,j) = fluxes%latent(i,j)
12951296
enddo ; enddo
12961297

1297-
call data_override(G%Domain, 'snow', fluxes%fprec, day, scale=US%kg_m2s_to_RZ_T)
1298-
call data_override(G%Domain, 'rain', fluxes%lprec, day, scale=US%kg_m2s_to_RZ_T)
1299-
call data_override(G%Domain, 'runoff', fluxes%lrunoff, day, scale=US%kg_m2s_to_RZ_T)
1300-
call data_override(G%Domain, 'calving', fluxes%frunoff, day, scale=US%kg_m2s_to_RZ_T)
1298+
call data_override(G%Domain, 'snow', fluxes%fprec, day, scale=US%kg_m2s_to_RZ_T)
1299+
call data_override(G%Domain, 'rain', fluxes%lprec, day, scale=US%kg_m2s_to_RZ_T)
1300+
call data_override(G%Domain, 'seaice_melt', fluxes%seaice_melt, day, scale=US%kg_m2s_to_RZ_T)
1301+
call data_override(G%Domain, 'runoff', fluxes%lrunoff, day, scale=US%kg_m2s_to_RZ_T)
1302+
call data_override(G%Domain, 'calving', fluxes%frunoff, day, scale=US%kg_m2s_to_RZ_T)
13011303

13021304
! Read the SST and SSS fields for damping.
13031305
if (CS%restorebuoy) then !#CTRL# .or. associated(CS%ctrl_forcing_CSp)) then
@@ -1345,15 +1347,16 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, US
13451347
! assume solid runoff (calving) enters ocean at 0degC
13461348
! mass leaving ocean has heat_content determined in MOM_diabatic_driver.F90
13471349
do j=js,je ; do i=is,ie
1348-
fluxes%evap(i,j) = fluxes%evap(i,j) * G%mask2dT(i,j)
1349-
fluxes%lprec(i,j) = fluxes%lprec(i,j) * G%mask2dT(i,j)
1350-
fluxes%fprec(i,j) = fluxes%fprec(i,j) * G%mask2dT(i,j)
1351-
fluxes%lrunoff(i,j) = fluxes%lrunoff(i,j) * G%mask2dT(i,j)
1352-
fluxes%frunoff(i,j) = fluxes%frunoff(i,j) * G%mask2dT(i,j)
1353-
fluxes%lw(i,j) = fluxes%lw(i,j) * G%mask2dT(i,j)
1354-
fluxes%latent(i,j) = fluxes%latent(i,j) * G%mask2dT(i,j)
1355-
fluxes%sens(i,j) = fluxes%sens(i,j) * G%mask2dT(i,j)
1356-
fluxes%sw(i,j) = fluxes%sw(i,j) * G%mask2dT(i,j)
1350+
fluxes%evap(i,j) = fluxes%evap(i,j) * G%mask2dT(i,j)
1351+
fluxes%lprec(i,j) = fluxes%lprec(i,j) * G%mask2dT(i,j)
1352+
fluxes%fprec(i,j) = fluxes%fprec(i,j) * G%mask2dT(i,j)
1353+
fluxes%seaice_melt(i,j) = fluxes%seaice_melt(i,j) * G%mask2dT(i,j)
1354+
fluxes%lrunoff(i,j) = fluxes%lrunoff(i,j) * G%mask2dT(i,j)
1355+
fluxes%frunoff(i,j) = fluxes%frunoff(i,j) * G%mask2dT(i,j)
1356+
fluxes%lw(i,j) = fluxes%lw(i,j) * G%mask2dT(i,j)
1357+
fluxes%latent(i,j) = fluxes%latent(i,j) * G%mask2dT(i,j)
1358+
fluxes%sens(i,j) = fluxes%sens(i,j) * G%mask2dT(i,j)
1359+
fluxes%sw(i,j) = fluxes%sw(i,j) * G%mask2dT(i,j)
13571360

13581361
fluxes%latent_evap_diag(i,j) = fluxes%latent_evap_diag(i,j) * G%mask2dT(i,j)
13591362
fluxes%latent_fprec_diag(i,j) = -fluxes%fprec(i,j)*CS%latent_heat_fusion
@@ -1395,6 +1398,7 @@ subroutine buoyancy_forcing_zero(sfc_state, fluxes, day, dt, G, CS)
13951398
fluxes%evap(i,j) = 0.0
13961399
fluxes%lprec(i,j) = 0.0
13971400
fluxes%fprec(i,j) = 0.0
1401+
fluxes%seaice_melt(i,j) = 0.0
13981402
fluxes%vprec(i,j) = 0.0
13991403
fluxes%lrunoff(i,j) = 0.0
14001404
fluxes%frunoff(i,j) = 0.0
@@ -1438,6 +1442,7 @@ subroutine buoyancy_forcing_const(sfc_state, fluxes, day, dt, G, US, CS)
14381442
fluxes%evap(i,j) = 0.0
14391443
fluxes%lprec(i,j) = 0.0
14401444
fluxes%fprec(i,j) = 0.0
1445+
fluxes%seaice_melt(i,j) = 0.0
14411446
fluxes%vprec(i,j) = 0.0
14421447
fluxes%lrunoff(i,j) = 0.0
14431448
fluxes%frunoff(i,j) = 0.0
@@ -1486,6 +1491,7 @@ subroutine buoyancy_forcing_linear(sfc_state, fluxes, day, dt, G, US, CS)
14861491
fluxes%evap(i,j) = 0.0
14871492
fluxes%lprec(i,j) = 0.0
14881493
fluxes%fprec(i,j) = 0.0
1494+
fluxes%seaice_melt(i,j) = 0.0
14891495
fluxes%vprec(i,j) = 0.0
14901496
fluxes%lrunoff(i,j) = 0.0
14911497
fluxes%frunoff(i,j) = 0.0

config_src/drivers/solo_driver/user_surface_forcing.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ subroutine USER_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
154154
call safe_alloc_ptr(fluxes%evap, isd, ied, jsd, jed)
155155
call safe_alloc_ptr(fluxes%lprec, isd, ied, jsd, jed)
156156
call safe_alloc_ptr(fluxes%fprec, isd, ied, jsd, jed)
157+
call safe_alloc_ptr(fluxes%seaice_melt, isd, ied, jsd, jed)
157158
call safe_alloc_ptr(fluxes%lrunoff, isd, ied, jsd, jed)
158159
call safe_alloc_ptr(fluxes%frunoff, isd, ied, jsd, jed)
159160
call safe_alloc_ptr(fluxes%vprec, isd, ied, jsd, jed)
@@ -177,6 +178,7 @@ subroutine USER_buoyancy_forcing(sfc_state, fluxes, day, dt, G, US, CS)
177178
! and are positive downward - i.e. evaporation should be negative.
178179
fluxes%evap(i,j) = -0.0 * G%mask2dT(i,j)
179180
fluxes%lprec(i,j) = 0.0 * G%mask2dT(i,j)
181+
fluxes%seaice_melt(i,j) = 0.0 * G%mask2dT(i,j)
180182

181183
! vprec will be set later, if it is needed for salinity restoring.
182184
fluxes%vprec(i,j) = 0.0
@@ -313,7 +315,7 @@ end subroutine USER_surface_forcing_init
313315
!!
314316
!! USER_buoyancy() forcing is used to set the surface buoyancy
315317
!! forcing, which may include a number of fresh water flux fields
316-
!! (evap, lprec, fprec, lrunoff, frunoff, and
318+
!! (evap, lprec, fprec, seaice_melt, lrunoff, frunoff, and
317319
!! vprec) and the surface heat fluxes (sw, lw, latent and sens)
318320
!! if temperature and salinity are state variables, or it may simply
319321
!! be the buoyancy flux if it is not. This routine also has coded a

0 commit comments

Comments
 (0)