Skip to content

Commit

Permalink
Diag decimation prototype, coarsening by a factor of 2
Browse files Browse the repository at this point in the history
- Prototype zaps all diagnostics by a factor of 2
- Works only for the native grid diagnostics
- _z diagnostics complain about the local mask array index
  • Loading branch information
nikizadehgfdl committed Sep 18, 2018
1 parent dcdd9ae commit 7c4adcb
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 21 deletions.
36 changes: 35 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_zap2
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 Down Expand Up @@ -52,6 +52,23 @@ module MOM_grid
integer :: JsgB !< The start j-index of cell vertices within the global domain
integer :: JegB !< The end j-index of cell vertices within the global domain

integer :: isc_zap2 !< The start i-index of cell centers within the computational domain
integer :: iec_zap2 !< The end i-index of cell centers within the computational domain
integer :: jsc_zap2 !< The start j-index of cell centers within the computational domain
integer :: jec_zap2 !< The end j-index of cell centers within the computational domain
integer :: isd_zap2 !< The start i-index of cell centers within the data domain
integer :: ied_zap2 !< The end i-index of cell centers within the data domain
integer :: jsd_zap2 !< The start j-index of cell centers within the data domain
integer :: jed_zap2 !< The end j-index of cell centers within the data domain
integer :: IsdB_zap2 !< The start i-index of cell vertices within the data domain
integer :: IedB_zap2 !< The end i-index of cell vertices within the data domain
integer :: JsdB_zap2 !< The start j-index of cell vertices within the data domain
integer :: JedB_zap2 !< The end j-index of cell vertices within the data domain
integer :: isg_zap2 !< The start i-index of cell centers within the computational domain
integer :: ieg_zap2 !< The end i-index of cell centers within the computational domain
integer :: jsg_zap2 !< The start j-index of cell centers within the computational domain
integer :: jeg_zap2 !< The end j-index of cell centers within the computational domain

integer :: isd_global !< The value of isd in the global index space (decompoistion invariant).
integer :: jsd_global !< The value of isd in the global index space (decompoistion invariant).
integer :: idg_offset !< The offset between the corresponding global and local i-indices.
Expand Down Expand Up @@ -343,6 +360,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_zap2(G%Domain, G%isc_zap2, G%iec_zap2, G%jsc_zap2, G%jec_zap2,&
G%isd_zap2, G%ied_zap2, G%jsd_zap2, G%jed_zap2,&
G%isg_zap2, G%ieg_zap2, G%jsg_zap2, G%jeg_zap2)

! Set array sizes for fields that are discretized at tracer cell boundaries.
! G%IscB_zap2 = G%isc_zap2 ; G%JscB_zap2 = G%jsc_zap2
G%IsdB_zap2 = G%isd_zap2 ; G%JsdB_zap2 = G%jsd_zap2
! G%IsgB_zap2 = G%isg_zap2 ; G%JsgB_zap2 = G%jsg_zap2
if (G%symmetric) then
! G%IscB_zap2 = G%isc_zap2-1 ; G%JscB_zap2 = G%jsc_zap2-1
G%IsdB_zap2 = G%isd_zap2-1 ; G%JsdB_zap2 = G%jsd_zap2-1
! G%IsgB_zap2 = G%isg_zap2-1 ; G%JsgB_zap2 = G%jsg_zap2-1
endif
! G%IecB_zap2 = G%iec_zap2 ; G%JecB_zap2 = G%jec_zap2
G%IedB_zap2 = G%ied_zap2 ; G%JedB_zap2 = G%jed_zap2
! G%IegB_zap2 = G%ieg_zap2 ; G%JegB_zap2 = G%jeg_zap2

end subroutine MOM_grid_init


Expand Down
Loading

0 comments on commit 7c4adcb

Please sign in to comment.