Skip to content

Commit

Permalink
Two small tweaks to thinning (NOAA-EMC#734)
Browse files Browse the repository at this point in the history
This PR addresses GSI NOAA-EMC#731. It modifies the satthin.F90 routine to allow
data to be processed unthinned in the GSI without requiring exorbitant
resources and it removes an unnecessary thinning from the read_atms.f90
routine.

The change to satthin reduces the value of `itxmax` from 1.e9 to 1.e7
which should be sufficient for most sensors. But if a larger number is
required for a sensor, this may be passed in via optional argument.

This change will change results for ATMS only as documented in the
issue.
  • Loading branch information
ADCollard committed Apr 18, 2024
1 parent 29d9d8f commit d75f44a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/gsi/read_atms.f90
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,6 @@ subroutine read_atms(mype,val_tovs,ithin,isfcalc,&
dlat_earth = dlat_earth*deg2rad
dlon_earth = dlon_earth*deg2rad

! Just use every fifth scan position and scanline (and make sure that we have
! position 48 as we need it for scan bias)
if (5*NINT(REAL(IScan(Iob))/5_r_kind) /= IScan(IOb) .OR. &
5*NINT(REAL(IFov-3)/5_r_kind) /= IFOV -3 ) CYCLE ObsLoop

! Regional case
if(regional)then
call tll2xy(dlon_earth,dlat_earth,dlon,dlat,outside)
Expand Down
11 changes: 8 additions & 3 deletions src/gsi/satthin.F90
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ subroutine makegvals
end subroutine makegvals


subroutine makegrids(rmesh,ithin,n_tbin)
subroutine makegrids(rmesh,ithin,n_tbin,itxmax_in)
!$$$ subprogram documentation block
! . . . .
! subprogram: makegrids
Expand Down Expand Up @@ -386,7 +386,8 @@ subroutine makegrids(rmesh,ithin,n_tbin)

real(r_kind) ,intent(in ) :: rmesh
integer(i_kind),intent(in ) :: ithin
integer(i_kind),intent(in ), optional :: n_tbin
integer(i_kind),intent(in ), optional :: n_tbin
integer(i_kind),intent(in ), optional :: itxmax_in
real(r_kind),parameter:: r360 = 360.0_r_kind
integer(i_kind) i,j
integer(i_kind) mlonx,mlonj
Expand All @@ -402,7 +403,11 @@ subroutine makegrids(rmesh,ithin,n_tbin)
itx_all=0
if(abs(rmesh) <= one .or. ithin <= 0)then
use_all=.true.
itxmax=1e9
if (present(itxmax_in)) then
itxmax = itxmax_in
else
itxmax = 1e7
endif
allocate(icount(itxmax))
allocate(score_crit(itxmax))
do j=1,itxmax
Expand Down

0 comments on commit d75f44a

Please sign in to comment.