Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix write_incr #559

Merged
merged 23 commits into from
Apr 14, 2023
Merged
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b846b29
GitHub Issue NOAA-EMC/GSI#175. Use the global 127L B-Matrix in regio…
jderber-NOAA Aug 13, 2021
05f1c1f
Merge remote-tracking branch 'upstream/master'
jderber-NOAA Sep 30, 2021
059e402
Merge remote-tracking branch 'upstream/master'
jderber-NOAA Oct 15, 2021
f938842
GitHub Issue NOAA-EMC/GSI#219 Improve Minimization and fix bug in vqc
jderber-NOAA Oct 22, 2021
fafadac
Merge remote-tracking branch 'upstream/master'
jderber-NOAA Nov 3, 2021
52c5ae6
fix setupw
jderber-NOAA Nov 5, 2021
f00e377
Merge remote-tracking branch 'upstream/master'
jderber-NOAA Nov 16, 2021
7703367
Merge remote-tracking branch 'upstream/master'
jderber-NOAA Feb 17, 2022
9eb9606
Merge remote-tracking branch 'upstream/master'
jderber-NOAA Feb 23, 2022
3eb0e13
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Jun 17, 2022
ddced98
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Jun 29, 2022
f60343b
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Jul 11, 2022
8dbfbd1
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Jul 14, 2022
1554f65
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Jul 21, 2022
bf060fd
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Aug 29, 2022
3f073fa
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Nov 4, 2022
7f62d1c
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Jan 25, 2023
85cbdb1
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Feb 23, 2023
51a444b
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Mar 3, 2023
0be4126
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Mar 22, 2023
57fda95
Merge remote-tracking branch 'upstream/develop' into develop
jderber-NOAA Apr 13, 2023
333ec2b
Changes to write_incr for ticket # 558
jderber-NOAA Apr 13, 2023
768a703
Fix issue found by Ting in review.
jderber-NOAA Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/gsi/write_incr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
use general_sub2grid_mod, only: sub2grid_info

use gsi_bundlemod, only: gsi_bundle, gsi_bundlegetpointer
use gsi_bundlemod, only: assignment(=)
use control_vectors, only: control_vector

use constants, only: one, rad2deg, r1000
Expand Down Expand Up @@ -158,7 +159,6 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
! set up state space based off of xhatsave
! Convert from control space directly to physical
! space for comparison with obs.
call allocate_preds(sbiasinc)
do iii=1,nobs_bins
call allocate_state(svalinc(iii))
end do
Expand All @@ -168,7 +168,10 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
do iii=1,ntlevs_ens
call allocate_state(evalinc(iii))
end do

call allocate_preds(sbiasinc)
call control2state(xhatsave,mvalinc,sbiasinc)
call deallocate_preds(sbiasinc)

if (l4dvar) then
if (l_hyb_ens) then
Expand All @@ -193,6 +196,12 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
end do
end if
end if
do iii=1,ntlevs_ens
call deallocate_state(evalinc(iii))
end do
do iii=1,nsubwin
call deallocate_state(mvalinc(iii))
end do

! Check hydrometeors in control variables
iql = getindex(svars3d,'ql')
Expand All @@ -202,7 +211,7 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
iqg = getindex(svars3d,'qg')

istatus=0
call gsi_bundlegetpointer(gfs_bundle,'q', sub_qanl, iret); istatus=istatus+iret
call gsi_bundlegetpointer(svalinc(ibin2),'q', sub_qanl, iret); istatus=istatus+iret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch on this, no idea why this one is different from the rest... does this have any implcations for current GFSv16?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jderber-NOAA I am a little confused here. In the following around line 313 (in this program), there is
! compute q increment sub_q = sub_qanl(:,:,:) - ges_q1(:,:,:,ibin)
So, seems to me, the original code intentionally gets analysis q in full at the above (line 205) .
I am wondering why the original treatment is used . However, if the change of line 214 is used, the following line 313 should also be changed too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree good catch. I do not understand why this variable is handled differently. But the intent of this change is not to change the science, but to make the code work. The line is reverted to use gfs_bundle and the tests resubmitted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All regression tests passed and test of code was fine. I believe this is ready for re-review.

if (iql>0) call gsi_bundlegetpointer(svalinc(ibin2),'ql', sub_ql, iret); istatus=istatus+iret
if (iqi>0) call gsi_bundlegetpointer(svalinc(ibin2),'qi', sub_qi, iret); istatus=istatus+iret
if (iqr>0) call gsi_bundlegetpointer(svalinc(ibin2),'qr', sub_qr, iret); istatus=istatus+iret
Expand Down Expand Up @@ -527,6 +536,10 @@ subroutine write_fv3_inc_ (grd,sp_a,filename,mype_out,gfs_bundle,ibin)
endif
! ! cleanup and exit
call nccheck_incr(nf90_close(ncid_out))
deallocate(out3d)
do iii=1,nobs_bins
call deallocate_state(svalinc(iii))
end do
if ( mype == mype_out ) then
write(6,*) "FV3 netCDF increment written, file= "//trim(filename)//".nc"
end if
Expand Down