Skip to content

Commit 87c5b3b

Browse files
authored
Merge pull request #781 from xylar/fix-sign-of-dismf-heat
Fix the sign of the heat flux for DISMF
2 parents 588e1cc + c29cb31 commit 87c5b3b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compass/ocean/tests/global_ocean/init/remap_ice_shelf_melt.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ def remap_paolo(in_filename, base_mesh_filename, culled_mesh_filename,
223223
ds[field] = area_ratio * fwf
224224
ds[field].attrs['units'] = 'kg m^-2 s^-1'
225225
field = 'dataLandIceHeatFlux'
226-
ds[field] = (latent_heat_of_fusion *
227-
ds.dataLandIceFreshwaterFlux)
226+
ds[field] = -(latent_heat_of_fusion *
227+
ds.dataLandIceFreshwaterFlux)
228228
ds[field].attrs['units'] = 'W m^-2'
229229
logger.info('Writing the source dataset...')
230230
write_netcdf(ds, 'Paolo_2023_ismf_1992-2017_v1.0.nc')
@@ -233,10 +233,12 @@ def remap_paolo(in_filename, base_mesh_filename, culled_mesh_filename,
233233

234234
planar_flux = (fwf * planar_area).sum().values
235235
sphere_flux = (ds.dataLandIceFreshwaterFlux * sphere_area).sum().values
236+
heat_flux = (ds.dataLandIceHeatFlux * sphere_area).sum().values
236237

237238
logger.info(f'Area of a cell (m^2): {planar_area[0,0]:.1f}')
238239
logger.info(f'Total flux on plane (kg/s): {planar_flux:.1f}')
239240
logger.info(f'Total flux on sphere (kg/s): {sphere_flux:.1f}')
241+
logger.info(f'Total heat flux on sphere (W): {heat_flux:.1f}')
240242
logger.info('')
241243

242244
logger.info('Remapping...')
@@ -391,8 +393,8 @@ def remap_adusumilli(in_filename, base_mesh_filename, culled_mesh_filename,
391393
ds['y'] = (('y',), y)
392394
ds['dataLandIceFreshwaterFlux'] = (('y', 'x'),
393395
melt_rate * rho_ice / s_per_yr)
394-
ds['dataLandIceHeatFlux'] = (latent_heat_of_fusion *
395-
ds.dataLandIceFreshwaterFlux)
396+
ds['dataLandIceHeatFlux'] = -(latent_heat_of_fusion *
397+
ds.dataLandIceFreshwaterFlux)
396398
logger.info('Writing the source dataset...')
397399
write_netcdf(ds, 'Adusumilli_2020_ismf_2010-2018_v0.nc')
398400
logger.info('done.')

0 commit comments

Comments
 (0)