Skip to content

Add _FillValue to all active and debug tracer fields #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions src/core_ocean/shared/mpas_ocn_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module ocn_diagnostics
use mpas_vector_reconstruction
use mpas_stream_manager
use mpas_io_units
use mpas_io, only : MPAS_REAL_FILLVAL

use ocn_constants
use ocn_config
Expand Down Expand Up @@ -168,7 +169,7 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic
! (positive points from vertex1 to vertex2)
! units: s^{-1} m^{-1}
real (kind=RKIND), dimension(:,:), allocatable :: vorticityGradientTangentialComponent


real (kind=RKIND), dimension(:), pointer :: surfaceFluxAttenuationCoefficient
real (kind=RKIND), dimension(:), pointer :: surfaceFluxAttenuationCoefficientRunoff
Expand Down Expand Up @@ -331,8 +332,8 @@ subroutine ocn_diagnostic_solve(dt, statePool, forcingPool, meshPool, diagnostic

normalVelocity(:,nEdges+1) = -1e34
layerThickness(:,nCells+1) = -1e34
activeTracers(indexTemperature,:,nCells+1) = -1e34
activeTracers(indexSalinity,:,nCells+1) = -1e34
activeTracers(indexTemperature,:,nCells+1) = MPAS_REAL_FILLVAL
activeTracers(indexSalinity,:,nCells+1) = MPAS_REAL_FILLVAL

call ocn_relativeVorticity_circulation(relativeVorticity, circulation, meshPool, normalVelocity, err)

Expand Down
7 changes: 4 additions & 3 deletions src/core_ocean/shared/mpas_ocn_init_routines.F
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module ocn_init_routines
use mpas_timer
use mpas_dmpar
use mpas_constants
use mpas_io, only : MPAS_REAL_FILLVAL

use mpas_rbf_interpolation
use mpas_vector_operations
Expand Down Expand Up @@ -539,7 +540,7 @@ subroutine ocn_init_routines_vert_coord(domain)!{{{
do iCell = 1,nCells
if (landIceMask(iCell)==0.and.abs(sum(layerThickness(1:maxLevelCell(iCell),iCell))-bottomDepth(iCell))>20.0_RKIND) then
consistentSSH = .false.
call mpas_log_write(' Warning: Sea surface height is outside of acceptable physical range, i.e. abs(sum(h)-bottomDepth)>20m.', &
call mpas_log_write(' Warning: Sea surface height is outside of acceptable physical range, i.e. abs(sum(h)-bottomDepth)>20m.', &
MPAS_LOG_ERR)
call mpas_log_write(' iCell: $i, maxLevelCell(iCell): $i, bottomDepth(iCell): $r, sum(h): $r', &
intArgs=(/iCell, maxLevelCell(iCell) /), &
Expand All @@ -550,7 +551,7 @@ subroutine ocn_init_routines_vert_coord(domain)!{{{
do iCell = 1,nCells
if (abs(sum(layerThickness(1:maxLevelCell(iCell),iCell))-bottomDepth(iCell))>20.0_RKIND) then
consistentSSH = .false.
call mpas_log_write(' Warning: Sea surface height is outside of acceptable physical range, i.e. abs(sum(h)-bottomDepth)>20m.', &
call mpas_log_write(' Warning: Sea surface height is outside of acceptable physical range, i.e. abs(sum(h)-bottomDepth)>20m.', &
MPAS_LOG_ERR)
call mpas_log_write(' iCell: $i, maxLevelCell(iCell): $i, bottomDepth(iCell): $r, sum(h): $r', &
intArgs=(/iCell, maxLevelCell(iCell) /), &
Expand Down Expand Up @@ -704,7 +705,7 @@ subroutine ocn_init_routines_block(block, dt, err)!{{{
call mpas_pool_get_array(tracersPool, groupItr % memberName, tracersGroup, 1)
if ( associated(tracersGroup) ) then
do iCell=1,nCells
tracersGroup(:, maxLevelCell(iCell)+1:nVertLevels,iCell) = -1.0e34_RKIND
tracersGroup(:, maxLevelCell(iCell)+1:nVertLevels,iCell) = MPAS_REAL_FILLVAL
end do
end if
end if
Expand Down
3 changes: 2 additions & 1 deletion src/core_ocean/shared/mpas_ocn_vmix.F
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module ocn_vmix
use mpas_derived_types
use mpas_pool_routines
use mpas_timer
use mpas_io, only : MPAS_REAL_FILLVAL

use mpas_constants
use ocn_constants
Expand Down Expand Up @@ -986,7 +987,7 @@ subroutine ocn_tracer_vmix_tend_implicit(meshPool, dt, vertDiffTopOfCell, layerT
tracersTemp, N, nVertLevels, num_tracers)

tracers(:,1:N,iCell) = tracersTemp(:,1:N)
tracers(:,N+1:nVertLevels,iCell) = -1e34
tracers(:,N+1:nVertLevels,iCell) = MPAS_REAL_FILLVAL
end do
!$omp end do
!$omp end parallel
Expand Down
6 changes: 3 additions & 3 deletions src/core_ocean/tracer_groups/Registry_activeTracers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<var_struct name="state" time_levs="2">
<var_struct name="tracers" time_levs="2">
<var_array name="activeTracers" dimensions="nVertLevels nCells Time" type="real" packages="activeTracersPKG" >
<var_array name="activeTracers" dimensions="nVertLevels nCells Time" type="real" packages="activeTracersPKG" missing_value="FILLVAL">
<var name="temperature" array_group="activeGRP" units="degrees Celsius"
description="potential temperature"
/>
Expand Down Expand Up @@ -139,15 +139,15 @@
</var_array>
</var_struct>
<var_struct name="tracersInteriorRestoringFields" time_levs="1">
<var_array name="activeTracersInteriorRestoringRate" type="real" dimensions="nVertLevels nCells Time" packages="activeTracersInteriorRestoringPKG">
<var_array name="activeTracersInteriorRestoringRate" type="real" dimensions="nVertLevels nCells Time" packages="activeTracersInteriorRestoringPKG" missing_value="FILLVAL">
<var name="temperatureInteriorRestoringRate" array_group="activeGRP" units="{s}^-1"
description="A non-negative field controlling the rate at which temperature is restored to temperatureInteriorRestoringValue"
/>
<var name="salinityInteriorRestoringRate" array_group="activeGRP" units="{s}^-1"
description="A non-negative field controlling the rate at which salinity is restored to salinityInteriorRestoringValue"
/>
</var_array>
<var_array name="activeTracersInteriorRestoringValue" type="real" dimensions="nVertLevels nCells Time" packages="activeTracersInteriorRestoringPKG">
<var_array name="activeTracersInteriorRestoringValue" type="real" dimensions="nVertLevels nCells Time" packages="activeTracersInteriorRestoringPKG" missing_value="FILLVAL">
<var name="temperatureInteriorRestoringValue" array_group="activeGRP" units="^\circ C"
description="Temperature is restored toward this field at a rate controlled by temperatureInteriorRestoringRate."
/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_ocean/tracer_groups/Registry_debugTracers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<var_struct name="state" time_levs="2">
<var_struct name="tracers" time_levs="2">
<var_array name="debugTracers" dimensions="nVertLevels nCells Time" type="real" packages="debugTracersPKG" default_value="1.0">
<var_array name="debugTracers" dimensions="nVertLevels nCells Time" type="real" packages="debugTracersPKG" default_value="1.0" missing_value="FILLVAL">
<var name="tracer1" array_group="debugGRP" units="tracer1"
description="tracer for debugging purposes"
/>
Expand Down