Skip to content

Commit

Permalink
These changes make the number of observations read (nread) independen…
Browse files Browse the repository at this point in the history
…t of the thinning routine (itxmax).
  • Loading branch information
wx20jjung committed Sep 11, 2024
1 parent 3990e48 commit a41a78a
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 22 deletions.
6 changes: 4 additions & 2 deletions src/gsi/combine_radobs.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
subroutine combine_radobs(mype_sub,mype_root,&
npe_sub,mpi_comm_sub,nele,itxmax,nread,ndata,&
npe_sub,mpi_comm_sub,nele,itxmax,nread,number_profiles,ndata,&
data_all,data_crit,nrec)
!$$$ subprogram documentation block
! . . . .
Expand All @@ -24,6 +24,7 @@ subroutine combine_radobs(mype_sub,mype_root,&
! itxmax - maximum number of observations
! data_all - observation data array
! data_crit- array containing observation "best scores"
! number_profiles - task specific number of radiance profiless passing quality control
! nread - task specific number of obesrvations read from data file
! ndata - task specific number of observations keep for assimilation
!
Expand All @@ -50,6 +51,7 @@ subroutine combine_radobs(mype_sub,mype_root,&
integer(i_kind) ,intent(in ) :: npe_sub,itxmax
integer(i_kind) ,intent(in ) :: nele
integer(i_kind) ,intent(in ) :: mpi_comm_sub
integer(i_kind) ,intent(in ) :: number_profiles
integer(i_kind) ,intent(inout) :: nread,ndata
integer(i_kind),dimension(itxmax) ,intent(in ) :: nrec
real(r_kind),dimension(itxmax) ,intent(inout) :: data_crit
Expand Down Expand Up @@ -83,7 +85,7 @@ subroutine combine_radobs(mype_sub,mype_root,&
! is only needed on task mype_root
call mpi_allreduce(data_crit,data_crit_min,itxmax,mpi_rtype,mpi_min,mpi_comm_sub,ierror)

allocate(nloc(min(ncounts1,itxmax)),icrit(min(ncounts1,itxmax)))
allocate(nloc(itxmax),icrit(itxmax))
icrit=1e9
ndata=0
ndata1=0
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_abi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ subroutine read_abi(mype,val_abi,ithin,rmesh,jsatid,&
close(lnbufr)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! Allow single task to check for bad obs, update superobs sum,
! and write out data to scratch file for further processing.
Expand Down
6 changes: 4 additions & 2 deletions src/gsi/read_aerosol.f90
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ subroutine read_aerosol(nread,ndata,nodata,jsatid,infile,gstime,lunout, &
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
naerodat,itxmax,number_profiles,ndata,aeroout,score_crit,nrec)
naerodat,itxmax,nread,number_profiles,ndata,aeroout,score_crit,nrec)

if ( mype_sub == mype_root ) then
do n = 1, ndata
Expand Down Expand Up @@ -582,8 +582,10 @@ subroutine read_aerosol(nread,ndata,nodata,jsatid,infile,gstime,lunout, &
nrec(itx)=irec
end do read_viirs

number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
naerodat,itxmax,nread,ndata,aeroout,score_crit,nrec)
naerodat,itxmax,nread,number_profiles,ndata,aeroout,score_crit,nrec)

if ( mype_sub == mype_root ) then
do n = 1, ndata
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_ahi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ subroutine read_ahi(mype,val_img,ithin,rmesh,jsatid,gstime,&
close(lnbufr)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! If no observations read, jump to end of routine.
if (mype_sub==mype_root.and.ndata>0) then
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_amsr2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ subroutine read_amsr2(mype,val_amsr2,ithin,rmesh,jsatid,gstime,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! Allow single task to check for bad obs, update superobs sum,
! and write out data to scratch file for further processing.
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_amsre.f90
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ subroutine read_amsre(mype,val_amsre,ithin,isfcalc,rmesh,jsatid,gstime,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)


! Allow single task to check for bad obs, update superobs sum,
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_atms.f90
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ subroutine read_atms(mype,val_tovs,ithin,isfcalc,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

!
if(mype_sub==mype_root)then
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_avhrr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ subroutine read_avhrr(mype,val_avhrr,ithin,rmesh,jsatid,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata_mesh,data_mesh,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata_mesh,data_mesh,score_crit,nrec)

if ( nread > 0 ) then
write(*,'(a,a10,I3,F6.1,3I10)') 'read_avhrr,satid,imesh,amesh,itxmax,nread,ndata_mesh : ',jsatid,imesh,amesh(imesh),itxmax,nread,ndata_mesh
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_avhrr_navy.f90
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ subroutine read_avhrr_navy(mype,val_avhrr,ithin,rmesh,jsatid,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)


! Now that we've identified the "best" observations, pull out best obs
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_bufrtovs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ subroutine read_bufrtovs(mype,val_tovs,ithin,isfcalc,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

!
if(mype_sub==mype_root)then
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_cris.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ subroutine read_cris(mype,val_cris,ithin,isfcalc,rmesh,jsatid,gstime,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! Allow single task to check for bad obs, update superobs sum,
! and write out data to scratch file for further processing.
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_gmi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ subroutine read_gmi(mype,val_gmi,ithin,rmesh,jsatid,gstime,&
! If multiple tasks read input bufr file, allow each tasks to write out
! information it retained and then let single task merge files together
call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

if( mype_sub==mype_root) write(6,*) 'READ_GMI: after combine_obs, nread,ndata is ',nread,ndata

Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_goesimg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ subroutine read_goesimg(mype,val_img,ithin,rmesh,jsatid,gstime,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! If no observations read, jump to end of routine.
if (mype_sub==mype_root.and.ndata>0) then
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_goesndr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ subroutine read_goesndr(mype,val_goes,ithin,rmesh,jsatid,infile,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)


! Allow single task to check for bad obs, update superobs sum,
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_iasi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ subroutine read_iasi(mype,val_iasi,ithin,isfcalc,rmesh,jsatid,gstime,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! Allow single task to check for bad obs, update superobs sum,
! and write out data to scratch file for further processing.
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_saphir.f90
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ subroutine read_saphir(mype,val_tovs,ithin,isfcalc,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

if(mype_sub==mype_root)then
do n=1,ndata
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_seviri.f90
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ subroutine read_seviri(mype,val_sev,ithin,rmesh,jsatid,&
close(lnbufr)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,nread,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,nread,ndata,data_all,score_crit,nrec)

! Allow single task to check for bad obs, update superobs sum,
! and write out data to scratch file for further processing.
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_ssmi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ subroutine read_ssmi(mype,val_ssmi,ithin,rmesh,jsatid,gstime,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

write(6,*) 'READ_SSMI: after combine_obs, nread,ndata is ',nread,ndata

Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_ssmis.f90
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ subroutine read_ssmis(mype,val_ssmis,ithin,isfcalc,rmesh,jsatid,gstime,&
! information it retained and then let single task merge files together

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata,data_all,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata,data_all,score_crit,nrec)

! Allow single task to check for bad obs, update superobs sum,
! and write out data to scratch file for further processing.
Expand Down
2 changes: 1 addition & 1 deletion src/gsi/read_viirs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ subroutine read_sst_viirs(mype,val_viirs,ithin,rmesh,jsatid,&
number_profiles = count(nrec(:) /= 999999,dim=1)

call combine_radobs(mype_sub,mype_root,npe_sub,mpi_comm_sub,&
nele,itxmax,number_profiles,ndata_mesh,data_mesh,score_crit,nrec)
nele,itxmax,nread,number_profiles,ndata_mesh,data_mesh,score_crit,nrec)

if ( nread > 0 ) then
write(*,'(a,a11,I3,F6.1,3I10)') 'read_viirs,jsatid,imesh,amesh,itxmax,nread,ndata_mesh :',jsatid,imesh,amesh(imesh),itxmax,nread,ndata_mesh
Expand Down

0 comments on commit a41a78a

Please sign in to comment.