From d75f44a34419e719e78cc2fb21b33fcfa428ada7 Mon Sep 17 00:00:00 2001 From: Andrew Collard <40322596+ADCollard@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:30:17 -0400 Subject: [PATCH] Two small tweaks to thinning (#734) This PR addresses GSI #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. --- src/gsi/read_atms.f90 | 5 ----- src/gsi/satthin.F90 | 11 ++++++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gsi/read_atms.f90 b/src/gsi/read_atms.f90 index c6ed159068..424843a7c1 100644 --- a/src/gsi/read_atms.f90 +++ b/src/gsi/read_atms.f90 @@ -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) diff --git a/src/gsi/satthin.F90 b/src/gsi/satthin.F90 index 93f193014f..c093c4b1d5 100644 --- a/src/gsi/satthin.F90 +++ b/src/gsi/satthin.F90 @@ -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 @@ -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 @@ -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