ok; (I think )I found the error. I would be grateful if somebody familiar with the source code could check it. Or should I contact the “Current Code Owner”?
Inside the ‘src_decomposition.f90’ inside the ‘ SUBROUTINE decompose_cm’, there are local variables ‘nzbounds_e, nzbounds_w, nzbounds_s, nzbounds_n’. Normally these have the value 2, and cause 2 additional pixels on each side of the respective coarse grid (which are needed later on during interpolation).
But if ‘east/…/north_add_in’ are used these ‘nzbounds_?’ are set to zero and cause (during the end of the 3rd Section of the subroutine) a too small coarse “sub”-grid.
I changed it so that the 2 additional pixels are still taken but afterwards a check is made, that caps the value to (1,ie_in_tot) and (1,je_in_tot)
!< ZENTEK nzbounds_e = 2 nzbounds_w = 2 nzbounds_s = 2 nzbounds_n = 2 !ZENTEK> ! looking for southern grid point DO j = 1, je_in_tot IF (latitudes_in(j) >= zminlat) THEN jzstart_in = j-nzbounds_s-1 EXIT ENDIF ENDDO ! looking for northern grid point DO j = 1, je_in_tot IF (latitudes_in(j) > zmaxlat) THEN jzend_in = j+nzbounds_n EXIT ENDIF ENDDO ! looking for western grid point DO i = 1, ie_in_tot IF (longitudes_in(i) >= zminlon) THEN izstart_in = i-nzbounds_e-1 EXIT ENDIF ENDDO ! looking for eastern grid point DO i = 1, ie_in_tot IF (longitudes_in(i) > zmaxlon) THEN izend_in = i+nzbounds_w EXIT ENDIF ENDDO !< ZENTEK IF (jzstart_in < 1) THEN jzstart_in = 1 ENDIF IF (jzend_in > ie_in_tot ) THEN jzend_in = ie_in_tot ENDIF IF (izstart_in < 1) THEN izstart_in = 1 ENDIF IF (izend_in > ie_in_tot) THEN izend_in = ie_in_tot ENDIF !ZENTEK>All in all I think these 4+3*4 lines should solve the problem.
Leaving only the small error directly over the south pole, which can be ‘workarounded’(*) by the 3 lines of code from my last post.
ok; (I think )I found the error. I would be grateful if somebody familiar with the source code could check it. Or should I contact the “Current Code Owner”?
Inside the ‘src_decomposition.f90’ inside the ‘ SUBROUTINE decompose_cm’, there are local variables ‘nzbounds_e, nzbounds_w, nzbounds_s, nzbounds_n’. Normally these have the value 2, and cause 2 additional pixels on each side of the respective coarse grid (which are needed later on during interpolation).
But if ‘east/…/north_add_in’ are used these ‘nzbounds_?’ are set to zero and cause (during the end of the 3rd Section of the subroutine) a too small coarse “sub”-grid.
I changed it so that the 2 additional pixels are still taken but afterwards a check is made, that caps the value to (1,ie_in_tot) and (1,je_in_tot)
!< ZENTEK nzbounds_e = 2 nzbounds_w = 2 nzbounds_s = 2 nzbounds_n = 2 !ZENTEK> ! looking for southern grid point DO j = 1, je_in_tot IF (latitudes_in(j) >= zminlat) THEN jzstart_in = j-nzbounds_s-1 EXIT ENDIF ENDDO ! looking for northern grid point DO j = 1, je_in_tot IF (latitudes_in(j) > zmaxlat) THEN jzend_in = j+nzbounds_n EXIT ENDIF ENDDO ! looking for western grid point DO i = 1, ie_in_tot IF (longitudes_in(i) >= zminlon) THEN izstart_in = i-nzbounds_e-1 EXIT ENDIF ENDDO ! looking for eastern grid point DO i = 1, ie_in_tot IF (longitudes_in(i) > zmaxlon) THEN izend_in = i+nzbounds_w EXIT ENDIF ENDDO !< ZENTEK IF (jzstart_in < 1) THEN jzstart_in = 1 ENDIF IF (jzend_in > ie_in_tot ) THEN jzend_in = ie_in_tot ENDIF IF (izstart_in < 1) THEN izstart_in = 1 ENDIF IF (izend_in > ie_in_tot) THEN izend_in = ie_in_tot ENDIF !ZENTEK>All in all I think these 4+3*4 lines should solve the problem.
Leaving only the small error directly over the south pole, which can be ‘workarounded’(*) by the 3 lines of code from my last post.