diff --git a/components/mpas-ocean/src/mode_init/Registry_global_ocean.xml b/components/mpas-ocean/src/mode_init/Registry_global_ocean.xml index 0ef1ff95245f..3e3d6e9e4790 100644 --- a/components/mpas-ocean/src/mode_init/Registry_global_ocean.xml +++ b/components/mpas-ocean/src/mode_init/Registry_global_ocean.xml @@ -136,7 +136,7 @@ possible_values="Any real positive number." /> - - - - - - - - - - + - 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 926400345e65..2476d01aa8f4 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 @@ -1072,14 +956,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 @@ -1088,95 +973,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)) @@ -1188,13 +1003,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) @@ -1204,28 +1018,25 @@ 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 + modifyLandIcePressureMask(:) = 0 do iCell = 1, nCells + ! nothing to do here if the cell is land + if (maxLevelCell(iCell) <= 0) cycle 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 + landIceDraft(iCell) = landIceDraftObserved(iCell) + landIcePressure(iCell) = landIcePressureObserved(iCell) + if (landIcePressure(iCell) > 0.0_RKIND) then modifyLandIcePressureMask(iCell) = 1 end if end do @@ -2726,26 +2537,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 @@ -2840,9 +2631,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, & @@ -2894,12 +2682,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', & @@ -3017,6 +2799,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 @@ -3075,29 +2865,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!}}}