Skip to content

Commit

Permalink
Merge pull request mom-ocean#869 from nikizadehgfdl/nikizadeh_diag_de…
Browse files Browse the repository at this point in the history
…cimation

Diagnostics Downsampling by a factor 2 for MOM6
  • Loading branch information
Hallberg-NOAA authored Mar 26, 2019
2 parents 3ebcb68 + 8233da2 commit 00f634b
Show file tree
Hide file tree
Showing 3 changed files with 1,417 additions and 59 deletions.
20 changes: 19 additions & 1 deletion src/core/MOM_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module MOM_grid

use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_domains, only : MOM_domain_type, get_domain_extent, compute_block_extent
use MOM_domains, only : get_global_shape
use MOM_domains, only : get_global_shape, get_domain_extent_dsamp2
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type

Expand All @@ -26,6 +26,7 @@ module MOM_grid
type(MOM_domain_type), pointer :: Domain => NULL() !< Ocean model domain
type(MOM_domain_type), pointer :: Domain_aux => NULL() !< A non-symmetric auxiliary domain type.
type(hor_index_type) :: HI !< Horizontal index ranges
type(hor_index_type) :: HId2 !< Horizontal index ranges for level-2-downsampling

integer :: isc !< The start i-index of cell centers within the computational domain
integer :: iec !< The end i-index of cell centers within the computational domain
Expand Down Expand Up @@ -348,6 +349,23 @@ subroutine MOM_grid_init(G, param_file, HI, global_indexing, bathymetry_at_vel)
if ( G%block(nblocks)%jed+G%block(nblocks)%jdg_offset > G%HI%jed + G%HI%jdg_offset ) &
call MOM_error(FATAL, "MOM_grid_init: G%jed_bk > G%jed")

call get_domain_extent_dsamp2(G%Domain, G%HId2%isc, G%HId2%iec, G%HId2%jsc, G%HId2%jec,&
G%HId2%isd, G%HId2%ied, G%HId2%jsd, G%HId2%jed,&
G%HId2%isg, G%HId2%ieg, G%HId2%jsg, G%HId2%jeg)

! Set array sizes for fields that are discretized at tracer cell boundaries.
G%HId2%IscB = G%HId2%isc ; G%HId2%JscB = G%HId2%jsc
G%HId2%IsdB = G%HId2%isd ; G%HId2%JsdB = G%HId2%jsd
G%HId2%IsgB = G%HId2%isg ; G%HId2%JsgB = G%HId2%jsg
if (G%symmetric) then
G%HId2%IscB = G%HId2%isc-1 ; G%HId2%JscB = G%HId2%jsc-1
G%HId2%IsdB = G%HId2%isd-1 ; G%HId2%JsdB = G%HId2%jsd-1
G%HId2%IsgB = G%HId2%isg-1 ; G%HId2%JsgB = G%HId2%jsg-1
endif
G%HId2%IecB = G%HId2%iec ; G%HId2%JecB = G%HId2%jec
G%HId2%IedB = G%HId2%ied ; G%HId2%JedB = G%HId2%jed
G%HId2%IegB = G%HId2%ieg ; G%HId2%JegB = G%HId2%jeg

end subroutine MOM_grid_init

!> rescale_grid_bathymetry permits a change in the internal units for the bathymetry on the grid,
Expand Down
Loading

0 comments on commit 00f634b

Please sign in to comment.