diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index 7eb4f528dbf3..825fe607a5b4 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -2934,8 +2934,8 @@ - - - - - - - - - - - + - diff --git a/components/mpas-ocean/src/mode_init/mpas_ocn_init_global_ocean.F b/components/mpas-ocean/src/mode_init/mpas_ocn_init_global_ocean.F index 0b810b193122..692a19b7c649 100644 --- a/components/mpas-ocean/src/mode_init/mpas_ocn_init_global_ocean.F +++ b/components/mpas-ocean/src/mode_init/mpas_ocn_init_global_ocean.F @@ -34,10 +34,10 @@ module ocn_init_global_ocean use ocn_constants use ocn_config use ocn_diagnostics_variables + use ocn_equation_of_state use ocn_init_cell_markers use ocn_init_vertical_grids use ocn_init_interpolation - use ocn_init_ssh_and_landIcePressure use ocn_init_smoothing implicit none @@ -75,7 +75,6 @@ module ocn_init_global_ocean integer :: nLatWind, nLonWind integer :: nLatTopo, nLonTopo integer :: nLonSW, nLatSW - integer :: nLatLandIceThk, nLonLandIceThk type (field1DReal) :: depthOutput type (field1DReal) :: tracerLat, tracerLon, tracerDepth @@ -85,8 +84,7 @@ module ocn_init_global_ocean type (field1DReal) :: landIceThkLat, landIceThkLon type (field2DReal) :: topoIC, zonalWindIC, meridionalWindIC, chlorophyllIC, zenithAngleIC, clearSkyIC - type (field2DReal) :: landIceThkIC, landIceDraftIC - type (field2DReal) :: oceanFracIC, landIceFracIC, groundedFracIC + type (field2DReal) :: oceanFracIC type (field3DReal) :: tracerIC, ecosysForcingIC @@ -126,12 +124,12 @@ subroutine ocn_init_setup_global_ocean(domain, iErr)!{{{ real (kind=RKIND), dimension(:, :), pointer :: PH_PREV_3D, PH_PREV_ALT_CO2_3D real (kind=RKIND), dimension(:, :), pointer :: FESEDFLUX - integer, dimension(:), pointer :: maxLevelCell + integer, dimension(:), pointer :: minLevelCell, maxLevelCell real (kind=RKIND), dimension(:, :), pointer :: normalVelocity real (kind=RKIND), dimension(:, :, :), pointer :: ecosysTracers, activeTracers, debugTracers, & DMSTracers, MacroMoleculesTracers - integer, pointer :: nVertLevels, nCellsSolve, tracerIndex + integer, pointer :: nVertLevels, nCellsSolve, nCells, tracerIndex integer :: iCell, k, iTracer integer, dimension(3) :: indexField @@ -196,10 +194,6 @@ subroutine ocn_init_setup_global_ocean(domain, iErr)!{{{ !*********************************************************************** if (config_global_ocean_depress_by_land_ice) then - if (config_global_ocean_topography_source == "latlon_file") then - call mpas_log_write( 'Reading land ice topography data.') - call ocn_init_setup_global_ocean_read_land_ice_topography(domain, iErr) - end if call mpas_log_write( 'Interpolating land ice topography data.') call ocn_init_setup_global_ocean_interpolate_land_ice_topography(domain, iErr) end if @@ -497,25 +491,9 @@ subroutine ocn_init_setup_global_ocean(domain, iErr)!{{{ if (config_global_ocean_depress_by_land_ice) then call mpas_log_write('Modifying temperature and surface restoring under land ice.') call ocn_init_setup_global_ocean_modify_temp_under_land_ice(domain, iErr) - - call mpas_log_write('Calculating land-ice pressure from the weight of ice shelves') - ! compute the land-ice pressure, also computing density along the way. - call ocn_init_ssh_and_landIcePressure_balance(domain, iErr) - - if(iErr .ne. 0) then - call mpas_log_write( 'ocn_init_ssh_and_landIcePressure_balance failed.', MPAS_LOG_CRIT) - call mpas_dmpar_finalize(domain % dminfo) - end if - - if (config_global_ocean_topography_source == "latlon_file") then - call mpas_log_write( 'Cleaning up land ice topography IC fields') - call ocn_init_global_ocean_destroy_land_ice_topography_fields() - end if end if call mpas_log_write( 'Copying restoring fields') - ! this occurs after ocn_init_ssh_and_landIcePressure_balance because activeTracers may have been remapped - ! to a new vertical coordinate call ocn_init_setup_global_ocean_interpolate_restoring(domain, iErr) call mpas_log_write( 'Compute Haney number') @@ -525,6 +503,33 @@ subroutine ocn_init_setup_global_ocean(domain, iErr)!{{{ call mpas_dmpar_finalize(domain % dminfo) end if + call mpas_log_write( 'Compute density') + block_ptr => domain % blocklist + do while(associated(block_ptr)) + + call mpas_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) + call mpas_pool_get_subpool(block_ptr % structs, 'state', statePool) + call mpas_pool_get_dimension(meshPool, 'nCells', nCells) + call mpas_pool_get_array(meshPool, 'minLevelCell', minLevelCell) + + do iCell = 1, nCells + do iTracer = 1,size(tracersSurfaceValue,1) + tracersSurfaceValue(iTracer, iCell) = activeTracers(iTracer, minLevelCell(iCell), iCell) + enddo + end do + + call ocn_equation_of_state_density(statePool, meshPool, tracersSurfaceValue, & + nCells, 0, 'relative', density, iErr, & + timeLevelIn=1) + + if(iErr .ne. 0) then + call mpas_log_write( 'ocn_equation_of_state_density failed.', MPAS_LOG_CRIT) + return + end if + + block_ptr => block_ptr % next + end do + if (config_global_ocean_cull_inland_seas) then call mpas_log_write( 'Removing inland seas.') call ocn_init_setup_global_ocean_cull_inland_seas(domain, iErr) @@ -638,127 +643,6 @@ subroutine ocn_init_setup_global_ocean_read_topo(domain, iErr)!{{{ end subroutine ocn_init_setup_global_ocean_read_topo!}}} -!*********************************************************************** -! -! routine ocn_init_setup_global_ocean_read_land_ice_topography -! -!> \brief Read the ice sheet thickness IC file -!> \author Jeremy Fyke, Xylar Asay-Davis, Mark Petersen (modified from Doug Jacobsen code) -!> \date 06/15/2015 -!> \details -!> This routine reads the ice sheet topography IC file, including latitude and longitude -!> information for ice sheet topography data. -! -!----------------------------------------------------------------------- - - subroutine ocn_init_setup_global_ocean_read_land_ice_topography(domain, iErr)!{{{ - type (domain_type), intent(inout) :: domain - integer, intent(out) :: iErr - - type (MPAS_Stream_type) :: landIceThicknessStream - - iErr = 0 - - ! Define stream for depth levels - call MPAS_createStream(landIceThicknessStream, domain % iocontext, config_global_ocean_land_ice_topo_file, & - MPAS_IO_NETCDF, MPAS_IO_READ, ierr=iErr) - - ! Setup landIceThkLat, landIceThkLon, and landIceThkIC fields for stream to be read in - landIceThkLat % fieldName = trim(config_global_ocean_land_ice_topo_lat_varname) - landIceThkLat % dimSizes(1) = nLatLandIceThk - landIceThkLat % dimNames(1) = trim(config_global_ocean_land_ice_topo_nlat_dimname) - landIceThkLat % isVarArray = .false. - landIceThkLat % isPersistent = .true. - landIceThkLat % isActive = .true. - landIceThkLat % hasTimeDimension = .false. - landIceThkLat % block => domain % blocklist - allocate(landIceThkLat % attLists(1)) - allocate(landIceThkLat % array(nLatLandIceThk)) - - landIceThkLon % fieldName = trim(config_global_ocean_land_ice_topo_lon_varname) - landIceThkLon % dimSizes(1) = nLonLandIceThk - landIceThkLon % dimNames(1) = trim(config_global_ocean_land_ice_topo_nlon_dimname) - landIceThkLon % isVarArray = .false. - landIceThkLon % isPersistent = .true. - landIceThkLon % isActive = .true. - landIceThkLon % hasTimeDimension = .false. - landIceThkLon % block => domain % blocklist - allocate(landIceThkLon % attLists(1)) - allocate(landIceThkLon % array(nLonLandIceThk)) - - landIceThkIC % fieldName = trim(config_global_ocean_land_ice_topo_thickness_varname) - landIceThkIC % dimSizes(1) = nLonLandIceThk - landIceThkIC % dimSizes(2) = nLatLandIceThk - landIceThkIC % dimNames(1) = trim(config_global_ocean_land_ice_topo_nlon_dimname) - landIceThkIC % dimNames(2) = trim(config_global_ocean_land_ice_topo_nlat_dimname) - landIceThkIC % isVarArray = .false. - landIceThkIC % isPersistent = .true. - landIceThkIC % isActive = .true. - landIceThkIC % hasTimeDimension = .false. - landIceThkIC % block => domain % blocklist - allocate(landIceThkIC % attLists(1)) - allocate(landIceThkIC % array(nLonLandIceThk, nLatLandIceThk)) - - landIceDraftIC % fieldName = trim(config_global_ocean_land_ice_topo_draft_varname) - landIceDraftIC % dimSizes(1) = nLonLandIceThk - landIceDraftIC % dimSizes(2) = nLatLandIceThk - landIceDraftIC % dimNames(1) = trim(config_global_ocean_land_ice_topo_nlon_dimname) - landIceDraftIC % dimNames(2) = trim(config_global_ocean_land_ice_topo_nlat_dimname) - landIceDraftIC % isVarArray = .false. - landIceDraftIC % isPersistent = .true. - landIceDraftIC % isActive = .true. - landIceDraftIC % hasTimeDimension = .false. - landIceDraftIC % block => domain % blocklist - allocate(landIceDraftIC % attLists(1)) - allocate(landIceDraftIC % array(nLonLandIceThk, nLatLandIceThk)) - - landIceFracIC % fieldName = trim(config_global_ocean_land_ice_topo_ice_frac_varname) - landIceFracIC % dimSizes(1) = nLonLandIceThk - landIceFracIC % dimSizes(2) = nLatLandIceThk - landIceFracIC % dimNames(1) = trim(config_global_ocean_land_ice_topo_nlon_dimname) - landIceFracIC % dimNames(2) = trim(config_global_ocean_land_ice_topo_nlat_dimname) - landIceFracIC % isVarArray = .false. - landIceFracIC % isPersistent = .true. - landIceFracIC % isActive = .true. - landIceFracIC % hasTimeDimension = .false. - landIceFracIC % block => domain % blocklist - allocate(landIceFracIC % attLists(1)) - allocate(landIceFracIC % array(nLonLandIceThk, nLatLandIceThk)) - - groundedFracIC % fieldName = trim(config_global_ocean_land_ice_topo_grounded_frac_varname) - groundedFracIC % dimSizes(1) = nLonLandIceThk - groundedFracIC % dimSizes(2) = nLatLandIceThk - groundedFracIC % dimNames(1) = trim(config_global_ocean_land_ice_topo_nlon_dimname) - groundedFracIC % dimNames(2) = trim(config_global_ocean_land_ice_topo_nlat_dimname) - groundedFracIC % isVarArray = .false. - groundedFracIC % isPersistent = .true. - groundedFracIC % isActive = .true. - groundedFracIC % hasTimeDimension = .false. - groundedFracIC % block => domain % blocklist - allocate(groundedFracIC % attLists(1)) - allocate(groundedFracIC % array(nLonLandIceThk, nLatLandIceThk)) - - ! Add landIceThkLat, landIceThkLon, and landIceThkIC fields to stream - call MPAS_streamAddField(landIceThicknessStream, landIceThkLat, iErr) - call MPAS_streamAddField(landIceThicknessStream, landIceThkLon, iErr) - call MPAS_streamAddField(landIceThicknessStream, landIceThkIC, iErr) - call MPAS_streamAddField(landIceThicknessStream, landIceDraftIC, iErr) - call MPAS_streamAddField(landIceThicknessStream, landIceFracIC, iErr) - call MPAS_streamAddField(landIceThicknessStream, groundedFracIC, iErr) - - ! Read stream - call MPAS_readStream(landIceThicknessStream, 1, iErr) - - ! Close stream - call MPAS_closeStream(landIceThicknessStream) - - if (config_global_ocean_land_ice_topo_latlon_degrees) then - landIceThkLat % array(:) = landIceThkLat % array(:) * pii / 180.0_RKIND - landIceThkLon % array(:) = landIceThkLon % array(:) * pii / 180.0_RKIND - end if - - end subroutine ocn_init_setup_global_ocean_read_land_ice_topography!}}} - !*********************************************************************** ! ! routine ocn_init_setup_global_ocean_create_model_topo @@ -1073,14 +957,15 @@ subroutine ocn_init_setup_global_ocean_interpolate_land_ice_topography(domain, i statePool real (kind=RKIND), dimension(:), pointer :: latCell, lonCell - real (kind=RKIND), dimension(:), pointer :: landIceThkObserved, landIceDraftObserved, & + real (kind=RKIND), dimension(:), pointer :: landIceDraftObserved, & + landIcePressureObserved, & landIceFracObserved, & - landIceFloatingFracObserved, & - landIceGroundedFracObserved + landIceFloatingFracObserved - real (kind=RKIND), dimension(:), pointer :: landIcePressure, landIceFraction, & - landIceFloatingFraction, ssh, & - bottomDepth + real (kind=RKIND), dimension(:), pointer :: landIceDraft, & + landIcePressure, & + landIceFraction, & + landIceFloatingFraction integer, pointer :: nCells integer, dimension(:), pointer :: maxLevelCell, landIceMask, landIceFloatingMask @@ -1089,95 +974,25 @@ subroutine ocn_init_setup_global_ocean_interpolate_land_ice_topography(domain, i iErr = 0 - if (config_global_ocean_topography_source == "latlon_file") then - block_ptr => domain % blocklist - do while(associated(block_ptr)) - - call mpas_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) - call mpas_pool_get_subpool(block_ptr % structs, 'landIceInit', landIceInitPool) - call mpas_pool_get_dimension(meshPool, 'nCells', nCells) - - call mpas_pool_get_array(meshPool, 'latCell', latCell) - call mpas_pool_get_array(meshPool, 'lonCell', lonCell) - call mpas_pool_get_array(landIceInitPool, 'landIceDraftObserved', landIceDraftObserved) - call mpas_pool_get_array(landIceInitPool, 'landIceThkObserved', landIceThkObserved) - call mpas_pool_get_array(landIceInitPool, 'landIceFracObserved', landIceFracObserved) - call mpas_pool_get_array(landIceInitPool, 'landIceGroundedFracObserved', landIceGroundedFracObserved) - - if (config_global_ocean_topography_method .eq. "nearest_neighbor") then - - call ocn_init_interpolation_nearest_horiz(landIceThkLon % array, landIceThkLat % array, & - landIceThkIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceThkObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) - - call ocn_init_interpolation_nearest_horiz(landIceThkLon % array, landIceThkLat % array, & - landIceDraftIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceDraftObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) + ! Iteratively smooth land ice topography variables + if (config_global_ocean_topography_smooth_weight > 0) then + call ocn_init_smooth_field(domain, 'landIceDraftObserved', 'landIceInit', & + config_global_ocean_topography_smooth_iterations, & + config_global_ocean_topography_smooth_weight) - call ocn_init_interpolation_nearest_horiz(landIceThkLon % array, landIceThkLat % array, & - landIceFracIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceFracObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) + call ocn_init_smooth_field(domain, 'landIcePressureObserved', 'landIceInit', & + config_global_ocean_topography_smooth_iterations, & + config_global_ocean_topography_smooth_weight) - call ocn_init_interpolation_nearest_horiz(landIceThkLon % array, landIceThkLat % array, & - groundedFracIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceGroundedFracObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) + call ocn_init_smooth_field(domain, 'landIceFracObserved', 'landIceInit', & + config_global_ocean_topography_smooth_iterations, & + config_global_ocean_topography_smooth_weight) - elseif (config_global_ocean_topography_method .eq. "bilinear_interpolation") then - - call ocn_init_interpolation_bilinear_horiz(landIceThkLon % array, landIceThkLat % array, & - landIceThkIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceThkObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) - - call ocn_init_interpolation_bilinear_horiz(landIceThkLon % array, landIceThkLat % array, & - landIceDraftIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceDraftObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) - - call ocn_init_interpolation_bilinear_horiz(landIceThkLon % array, landIceThkLat % array, & - landIceFracIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceFracObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) - - call ocn_init_interpolation_bilinear_horiz(landIceThkLon % array, landIceThkLat % array, & - groundedFracIC % array, nLonLandIceThk, nLatLandIceThk, & - lonCell, latCell, landIceGroundedFracObserved, nCells, & - inXPeriod = 2.0_RKIND * pii) - - else - call mpas_log_write( 'Invalid choice of config_global_ocean_topography_method.', MPAS_LOG_CRIT) - iErr = 1 - call mpas_dmpar_finalize(domain % dminfo) - endif - - block_ptr => block_ptr % next - end do + call ocn_init_smooth_field(domain, 'landIceFloatingFracObserved', 'landIceInit', & + config_global_ocean_topography_smooth_iterations, & + config_global_ocean_topography_smooth_weight) end if - - ! Iteratively smooth landIceDraftObserved, landIceThkObserved, landIceFracObserved, - ! and landIceGroundedFracObserved before using them to adjust SSH, compute - ! land-ice pressure, etc. - call ocn_init_smooth_field(domain, 'landIceDraftObserved', 'landIceInit', & - config_global_ocean_topography_smooth_iterations, & - config_global_ocean_topography_smooth_weight) - - call ocn_init_smooth_field(domain, 'landIceThkObserved', 'landIceInit', & - config_global_ocean_topography_smooth_iterations, & - config_global_ocean_topography_smooth_weight) - - call ocn_init_smooth_field(domain, 'landIceFracObserved', 'landIceInit', & - config_global_ocean_topography_smooth_iterations, & - config_global_ocean_topography_smooth_weight) - - call ocn_init_smooth_field(domain, 'landIceGroundedFracObserved', 'landIceInit', & - config_global_ocean_topography_smooth_iterations, & - config_global_ocean_topography_smooth_weight) - block_ptr => domain % blocklist do while(associated(block_ptr)) @@ -1189,13 +1004,12 @@ subroutine ocn_init_setup_global_ocean_interpolate_land_ice_topography(domain, i call mpas_pool_get_array(meshPool, 'maxLevelCell', maxLevelCell) call mpas_pool_get_array(landIceInitPool, 'landIceDraftObserved', landIceDraftObserved) - call mpas_pool_get_array(landIceInitPool, 'landIceThkObserved', landIceThkObserved) + call mpas_pool_get_array(landIceInitPool, 'landIcePressureObserved', landIcePressureObserved) call mpas_pool_get_array(landIceInitPool, 'landIceFracObserved', landIceFracObserved) - call mpas_pool_get_array(landIceInitPool, 'landIceFracObserved', landIceFloatingFracObserved) - call mpas_pool_get_array(landIceInitPool, 'landIceGroundedFracObserved', landIceGroundedFracObserved) - call mpas_pool_get_array(statePool, 'ssh', ssh, 1) + call mpas_pool_get_array(landIceInitPool, 'landIceFloatingFracObserved', landIceFloatingFracObserved) call mpas_pool_get_array(forcingPool, 'landIceMask', landIceMask) call mpas_pool_get_array(forcingPool, 'landIceFloatingMask', landIceFloatingMask) + call mpas_pool_get_array(forcingPool, 'landIceDraft', landIceDraft) call mpas_pool_get_array(forcingPool, 'landIcePressure', landIcePressure) call mpas_pool_get_array(forcingPool, 'landIceFraction', landIceFraction) call mpas_pool_get_array(forcingPool, 'landIceFloatingFraction', landIceFloatingFraction) @@ -1205,29 +1019,23 @@ subroutine ocn_init_setup_global_ocean_interpolate_land_ice_topography(domain, i 'indicates that this field is missing in the initial condition file (e.g. ' // & 'because it is meant for an older E3SM version).', MPAS_LOG_CRIT) endif - ssh(:) = 0.0_RKIND landIceFraction(:) = 0.0_RKIND - modifyLandIcePressureMask(:) = 0 + landIceDraft(:) = 0.0_RKIND landIcePressure(:) = 0.0_RKIND + sshAdjustmentMask(:) = 0 do iCell = 1, nCells - - if (landIceMask(iCell) == 1) then - landIceFraction(iCell) = landIceFracObserved(iCell) - end if - - ! this implicitly assumes that when a cell is considered floating, the - ! full landIceFracObserved is floating - if (landIceFloatingMask(iCell) == 1) then - landIceFloatingFraction(iCell) = landIceFloatingFracObserved(iCell) - end if - ! nothing to do here if the cell is land if (maxLevelCell(iCell) <= 0) cycle - ! we compute the SSH first and find out the land-ice pressure - ssh(iCell) = min(0.0_RKIND, landIceDraftObserved(iCell)) - if (ssh(iCell) < 0.0_RKIND) then - modifyLandIcePressureMask(iCell) = 1 + ! don't mask these because we may want to include melt that bleeds + ! into the open ocean + landIceFraction(iCell) = landIceFracObserved(iCell) + landIceFloatingFraction(iCell) = landIceFloatingFracObserved(iCell) + + landIceDraft(iCell) = landIceDraftObserved(iCell) + landIcePressure(iCell) = landIcePressureObserved(iCell) + if (landIcePressure(iCell) > 0.0_RKIND) then + sshAdjustmentMask(iCell) = 1 end if end do @@ -2727,26 +2535,6 @@ subroutine ocn_init_global_ocean_destroy_topo_fields()!{{{ deallocate(topoLon % array) end subroutine ocn_init_global_ocean_destroy_topo_fields!}}} -!*********************************************************************** -! -! routine ocn_init_global_ocean_destroy_land_ice_topography_fields -! -!> \brief Topography field cleanup routine -!> \author Jeremy Fyke, Xylar Asay-Davis, Mark Petersen -!> \date 06/23/2015 -!> \details -!> This routine destroys the fields created to hold land ice topography -!> initial condition information -! -!----------------------------------------------------------------------- - - subroutine ocn_init_global_ocean_destroy_land_ice_topography_fields()!{{{ - deallocate(landIceThkIC % array) - deallocate(landIceDraftIC % array) - deallocate(landIceThkLat % array) - deallocate(landIceThkLon % array) - end subroutine ocn_init_global_ocean_destroy_land_ice_topography_fields!}}} - !*********************************************************************** ! ! routine ocn_init_global_ocean_destroy_windstress_fields @@ -2841,9 +2629,6 @@ subroutine ocn_init_validate_global_ocean(configPool, packagePool, iocontext, iE config_global_ocean_windstress_file, & config_global_ocean_windstress_nlat_dimname, & config_global_ocean_windstress_nlon_dimname, & - config_global_ocean_land_ice_topo_file, & - config_global_ocean_land_ice_topo_nlat_dimname, & - config_global_ocean_land_ice_topo_nlon_dimname, & config_global_ocean_swData_file, & config_global_ocean_swData_nlon_dimname, & config_global_ocean_swData_nlat_dimname, & @@ -2895,12 +2680,6 @@ subroutine ocn_init_validate_global_ocean(configPool, packagePool, iocontext, iE config_global_ocean_depress_by_land_ice) call mpas_pool_get_config(configPool, 'config_use_ecosysTracers', & config_use_ecosysTracers) - call mpas_pool_get_config(configPool, 'config_global_ocean_land_ice_topo_file', & - config_global_ocean_land_ice_topo_file) - call mpas_pool_get_config(configPool, 'config_global_ocean_land_ice_topo_nlat_dimname', & - config_global_ocean_land_ice_topo_nlat_dimname) - call mpas_pool_get_config(configPool, 'config_global_ocean_land_ice_topo_nlon_dimname', & - config_global_ocean_land_ice_topo_nlon_dimname) call mpas_pool_get_config(configPool, 'config_global_ocean_deepen_critical_passages', & config_global_ocean_deepen_critical_passages) call mpas_pool_get_config(configPool, 'config_global_ocean_windstress_file', & @@ -3018,6 +2797,14 @@ subroutine ocn_init_validate_global_ocean(configPool, packagePool, iocontext, iE return end if + if (config_global_ocean_topography_source == 'latlon_file' .and. & + config_global_ocean_depress_by_land_ice) then + call mpas_log_write( 'Land ice topography can no longer be read from ' & + // 'a lat-lon file', MPAS_LOG_CRIT) + iErr = 1 + return + end if + if (config_global_ocean_topography_source == 'latlon_file') then inputFile = MPAS_io_open(config_global_ocean_topography_file, MPAS_IO_READ, MPAS_IO_NETCDF, iocontext_ptr, ierr=iErr) if (iErr /= 0) then @@ -3076,29 +2863,6 @@ subroutine ocn_init_validate_global_ocean(configPool, packagePool, iocontext, iE end if - if (config_global_ocean_depress_by_land_ice) then - if (config_global_ocean_land_ice_topo_file == 'none' .and. & - config_global_ocean_topography_source == 'latlon_file') then - call mpas_log_write( 'Validation failed for global ocean. '// & - 'Invalid filename for config_global_ocean_land_ice_topo_file', MPAS_LOG_CRIT) - iErr = 1 - return - end if - - if(config_global_ocean_topography_source == 'latlon_file') then - inputFile = MPAS_io_open(config_global_ocean_land_ice_topo_file, MPAS_IO_READ, MPAS_IO_NETCDF, iocontext_ptr, ierr=iErr) - if (iErr /= 0) then - call mpas_log_write( 'could not open file '// trim(config_global_ocean_land_ice_topo_file), MPAS_LOG_CRIT) - return - end if - - call MPAS_io_inq_dim(inputFile, config_global_ocean_land_ice_topo_nlat_dimname, nLatLandIceThk, iErr) - call MPAS_io_inq_dim(inputFile, config_global_ocean_land_ice_topo_nlon_dimname, nLonLandIceThk, iErr) - - call MPAS_io_close(inputFile, iErr) - end if - end if - !-------------------------------------------------------------------- end subroutine ocn_init_validate_global_ocean!}}} diff --git a/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip.F b/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip.F index 5299d36abb5f..11874ea35d1f 100644 --- a/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip.F +++ b/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip.F @@ -274,7 +274,7 @@ subroutine ocn_init_setup_isomip(domain, iErr)!{{{ landIceFraction(:) = 0.0_RKIND landIceSurfaceTemperature(:) = -25.0_RKIND !doesn't matter because ice is insulating - modifyLandIcePressureMask(:) = 0 + sshAdjustmentMask(:) = 0 landIceMask(:) = 0 @@ -301,7 +301,7 @@ subroutine ocn_init_setup_isomip(domain, iErr)!{{{ end if if(ssh(iCell) < 0.0_RKIND) then - modifyLandIcePressureMask(iCell) = 1 + sshAdjustmentMask(iCell) = 1 end if if(.not. associated(activeTracers)) then diff --git a/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip_plus.F b/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip_plus.F index e38d546762f6..78436a13af4b 100644 --- a/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip_plus.F +++ b/components/mpas-ocean/src/mode_init/mpas_ocn_init_isomip_plus.F @@ -529,9 +529,9 @@ subroutine ocn_init_setup_isomip_plus_interpolate_topo(domain, iErr)!{{{ do iCell = 1,nCells if(landIceFraction(iCell) > 0.01_RKIND) then - modifyLandIcePressureMask(iCell) = 1 + sshAdjustmentMask(iCell) = 1 else - modifyLandIcePressureMask(iCell) = 0 + sshAdjustmentMask(iCell) = 0 end if end do @@ -605,7 +605,7 @@ subroutine ocn_init_setup_isomip_plus_interpolate_topo(domain, iErr)!{{{ ssh(iCell) = 0.0_RKIND landIceFraction(iCell) = 0.0_RKIND landIceMask(iCell) = 0 - modifyLandIcePressureMask(iCell) = 0 + sshAdjustmentMask(iCell) = 0 end if end do !iCell diff --git a/components/mpas-ocean/src/mode_init/mpas_ocn_init_ssh_and_landIcePressure.F b/components/mpas-ocean/src/mode_init/mpas_ocn_init_ssh_and_landIcePressure.F index c85249635a7d..e48f8982b6dc 100644 --- a/components/mpas-ocean/src/mode_init/mpas_ocn_init_ssh_and_landIcePressure.F +++ b/components/mpas-ocean/src/mode_init/mpas_ocn_init_ssh_and_landIcePressure.F @@ -159,7 +159,7 @@ subroutine ocn_init_ssh_and_landIcePressure_balance(domain, iErr)!{{{ end if do iCell = 1, nCells - if(modifyLandIcePressureMask(iCell) == 0) then + if(sshAdjustmentMask(iCell) == 0) then ssh(iCell) = 0.0_RKIND landIcePressure(iCell) = 0.0_RKIND diff --git a/components/mpas-ocean/src/mode_init/mpas_ocn_init_sub_ice_shelf_2D.F b/components/mpas-ocean/src/mode_init/mpas_ocn_init_sub_ice_shelf_2D.F index 6261b49e4b9e..81c84e43e6bf 100644 --- a/components/mpas-ocean/src/mode_init/mpas_ocn_init_sub_ice_shelf_2D.F +++ b/components/mpas-ocean/src/mode_init/mpas_ocn_init_sub_ice_shelf_2D.F @@ -223,7 +223,7 @@ subroutine ocn_init_setup_sub_ice_shelf_2D(domain, iErr)!{{{ if(associated(landIceFraction)) & landIceFraction(:) = 0.0_RKIND - modifyLandIcePressureMask(:) = 0 + sshAdjustmentMask(:) = 0 if(associated(landIceMask)) & landIceMask(:) = 0 @@ -241,7 +241,7 @@ subroutine ocn_init_setup_sub_ice_shelf_2D(domain, iErr)!{{{ ssh(iCell) = -config_sub_ice_shelf_2D_bottom_depth + totalSubIceThickness if(ssh(iCell) < 0.0_RKIND) then - modifyLandIcePressureMask(iCell) = 1 + sshAdjustmentMask(iCell) = 1 end if end do diff --git a/components/mpas-ocean/src/mode_init/mpas_ocn_init_vertical_grids.F b/components/mpas-ocean/src/mode_init/mpas_ocn_init_vertical_grids.F index 2fcbf507f7a3..bc535ec865fe 100644 --- a/components/mpas-ocean/src/mode_init/mpas_ocn_init_vertical_grids.F +++ b/components/mpas-ocean/src/mode_init/mpas_ocn_init_vertical_grids.F @@ -1079,7 +1079,7 @@ subroutine ocn_init_vertical_grid_with_max_rx1(domain, iErr) type (block_type), pointer :: block_ptr - type (mpas_pool_type), pointer :: meshPool, statePool, verticalMeshPool, scratchPool, forcingPool + type (mpas_pool_type), pointer :: meshPool, statePool, verticalMeshPool, scratchPool, diagnosticsPool integer, pointer :: config_rx1_outer_iter_count, config_rx1_inner_iter_count, & config_rx1_horiz_smooth_open_ocean_cells, config_rx1_min_levels @@ -1095,7 +1095,7 @@ subroutine ocn_init_vertical_grid_with_max_rx1(domain, iErr) real (kind=RKIND), dimension(:,:), pointer :: layerThickness, restingThickness, zInterface, & goalStretch, goalWeight - integer, dimension(:), pointer :: landIceMask + integer, dimension(:), pointer :: sshAdjustmentMask real (kind=RKIND), dimension(:), pointer :: ssh, bottomDepth, refBottomDepth, zTop, zBot, zBotNew, & refLayerThickness @@ -1142,14 +1142,14 @@ subroutine ocn_init_vertical_grid_with_max_rx1(domain, iErr) block_ptr => domain % blocklist do while(associated(block_ptr)) call mpas_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) - call mpas_pool_get_subpool(block_ptr % structs, 'forcing', forcingPool) + call mpas_pool_get_subpool(block_ptr % structs, 'diagnostics', diagnosticsPool) call mpas_pool_get_dimension(meshPool, 'nCells', nCells) call mpas_pool_get_array(meshPool, 'cullCell', cullCell) call mpas_pool_get_array(meshPool, 'maxLevelCell', maxLevelCell) - call mpas_pool_get_array(forcingPool, 'landIceMask', landIceMask) + call mpas_pool_get_array(diagnosticsPool, 'sshAdjustmentMask', sshAdjustmentMask) maxLevelCell(nCells+1) = -1 do iCell = 1, nCells @@ -1163,7 +1163,7 @@ subroutine ocn_init_vertical_grid_with_max_rx1(domain, iErr) ! initialize the smoothing mask to valid cells under land ice smoothingMask(:) = 0 - where((maxLevelCell(:) > 0) .and. (landIceMask(:) == 1)) + where((maxLevelCell(:) > 0) .and. (sshAdjustmentMask(:) == 1)) smoothingMask(:) = 1 end where diff --git a/components/mpas-ocean/src/shared/mpas_ocn_diagnostics_variables.F b/components/mpas-ocean/src/shared/mpas_ocn_diagnostics_variables.F index 00744a46737a..be7eef2d8060 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_diagnostics_variables.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_diagnostics_variables.F @@ -127,7 +127,7 @@ module ocn_diagnostics_variables integer, dimension(:), pointer :: smoothingMask real (kind=RKIND), dimension(:,:), pointer :: verticalStretch - integer, dimension(:), pointer :: modifyLandIcePressureMask + integer, dimension(:), pointer :: sshAdjustmentMask real (kind=RKIND), dimension(:,:), pointer :: velocityMeridional real (kind=RKIND), dimension(:,:), pointer :: velocityZonal @@ -697,8 +697,8 @@ subroutine ocn_diagnostics_variables_init(domain, jenkinsOn, hollandJenkinsOn, e call mpas_pool_get_field(diagnosticsPool, 'verticalStretch', & verticalStretchField, 1) call mpas_pool_get_array(diagnosticsPool, & - 'modifyLandIcePressureMask', & - modifyLandIcePressureMask) + 'sshAdjustmentMask', & + sshAdjustmentMask) call mpas_pool_get_array(diagnosticsPool, 'indMLD', indMLD) call mpas_pool_get_array(diagnosticsPool, 'dThreshMLD', dThreshMLD) call mpas_pool_get_array(diagnosticsPool, 'surfacePressure', &