Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions compass/ocean/tests/global_ocean/init/remap_ice_shelf_melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ def remap_paolo(in_filename, base_mesh_filename, culled_mesh_filename,
ds[field] = area_ratio * fwf
ds[field].attrs['units'] = 'kg m^-2 s^-1'
field = 'dataLandIceHeatFlux'
ds[field] = (latent_heat_of_fusion *
ds.dataLandIceFreshwaterFlux)
ds[field] = -(latent_heat_of_fusion *
ds.dataLandIceFreshwaterFlux)
Comment on lines +226 to +227
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darincomeau and @cbegeman, could you just review this by inspection when you can?

I will post output later this evening.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar Yes, I think this is exactly what we want. this is probably obvious, but when you do run the simulations, make sure the conservation AM is on.

ds[field].attrs['units'] = 'W m^-2'
logger.info('Writing the source dataset...')
write_netcdf(ds, 'Paolo_2023_ismf_1992-2017_v1.0.nc')
Expand All @@ -233,10 +233,12 @@ def remap_paolo(in_filename, base_mesh_filename, culled_mesh_filename,

planar_flux = (fwf * planar_area).sum().values
sphere_flux = (ds.dataLandIceFreshwaterFlux * sphere_area).sum().values
heat_flux = (ds.dataLandIceHeatFlux * sphere_area).sum().values

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

logger.info('Remapping...')
Expand Down Expand Up @@ -391,8 +393,8 @@ def remap_adusumilli(in_filename, base_mesh_filename, culled_mesh_filename,
ds['y'] = (('y',), y)
ds['dataLandIceFreshwaterFlux'] = (('y', 'x'),
melt_rate * rho_ice / s_per_yr)
ds['dataLandIceHeatFlux'] = (latent_heat_of_fusion *
ds.dataLandIceFreshwaterFlux)
ds['dataLandIceHeatFlux'] = -(latent_heat_of_fusion *
ds.dataLandIceFreshwaterFlux)
logger.info('Writing the source dataset...')
write_netcdf(ds, 'Adusumilli_2020_ismf_2010-2018_v0.nc')
logger.info('done.')
Expand Down