Skip to content

Commit

Permalink
Diag decimation, check the commensurate condition
Browse files Browse the repository at this point in the history
- Beware! Currently only commensurate layouts are supported. I.e.,
  the decimated subgrid cells should all be contained in the same core (pe).
  For this to happend the layout of the model runs should be chosen
  so that NIGLOBAL/layout_x and NJGLOBAL/layout_y are both divisible by dl
  (decimation level) if a _dl diagnostics is present in the diag_table
- This is a major limitition of the current implementation. But the extension
  to arbitrary layouts would required cross processor communications (halo updates)
  which may slow down the model considerably and beat the purpose of decimation.
  • Loading branch information
nikizadehgfdl committed Oct 25, 2018
1 parent 861397c commit de8f1b6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/framework/MOM_diag_mediator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3512,8 +3512,24 @@ subroutine decimate_diag_indices_get(f1,f2, dl, diag_cs,isv,iev,jsv,jev)
integer, intent(out) ::isv,iev,jsv,jev !< diagnostics-compute indices (to be passed to send_data)
! Local variables
integer :: dszi,cszi,dszj,cszj
character(len=300) :: mesg

character(len=500) :: mesg
logical, save :: first_check = .true.

!Check ONCE that the decimated diag-compute domain is commensurate with the original non-decimated diag-compute domain
!This is a major limitation of the current implementation of the decimated diagnostics.
!We assume that the compute domain can be subdivided to dl*dl cells, hence avoiding the need of halo updates.
!We want this check to error out only if there was a decimated diagnostics requested and about to post that is
!why the check is here and not in the init routines. This check need to be done only once, hence the outer if statement
if(first_check) then
if(mod(diag_cs%ie-diag_cs%is+1, dl) .ne. 0 .OR. mod(diag_cs%je-diag_cs%js+1, dl) .ne. 0) then
write (mesg,*) "Non-commensurate decimated domain is not supported. "//&
"Please choose a layout such that NIGLOBAL/Layout_X and NJGLOBAL/Layout_Y are both divisible by dl=",dl, " Current domain extents: ",&
diag_cs%is,diag_cs%ie, diag_cs%js,diag_cs%je
call MOM_error(FATAL,"decimate_diag_indices_get: "//trim(mesg))
endif
first_check = .false.
endif

cszi = diag_cs%decim(dl)%iec-diag_cs%decim(dl)%isc +1 ; dszi = diag_cs%decim(dl)%ied-diag_cs%decim(dl)%isd +1
cszj = diag_cs%decim(dl)%jec-diag_cs%decim(dl)%jsc +1 ; dszj = diag_cs%decim(dl)%jed-diag_cs%decim(dl)%jsd +1

Expand Down

0 comments on commit de8f1b6

Please sign in to comment.