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

Bugfix for where some fields are not in the input increment file #53

Merged
merged 8 commits into from
Sep 17, 2024

Conversation

CoryMartin-NOAA
Copy link
Contributor

Hopefully fixes problem found in NOAA-EMC/global-workflow#2819

Copy link
Contributor

@RussTreadon-NOAA RussTreadon-NOAA left a comment

Choose a reason for hiding this comment

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

Looks like it should work but I did not test.

@CoryMartin-NOAA
Copy link
Contributor Author

I'm a bit worried I was too simplistic with this given the MPI send/receive

@DavidHuber-NOAA
Copy link
Collaborator

Looks good, but I will give it a test in my current PR.

@CoryMartin-NOAA
Copy link
Contributor Author

If this hangs on MPI send/receive I think the next option is to just make a dummy array of all 0s for these missing fields

@RussTreadon-NOAA
Copy link
Contributor

I'm spinning up JEDI ATM g-w CI on Hera. I can test this PR in that parallel. @DavidHuber-NOAA may be able to get a test done more quickly via g-w PR #2819.

@CoryMartin-NOAA
Copy link
Contributor Author

I think the latest commit will be safer, it assigns the array as 0 so there won't be any MPI communication hangs.

@DavidHuber-NOAA
Copy link
Collaborator

Alright, I'll update to that version then.

@RussTreadon-NOAA
Copy link
Contributor

WCOSS2 (Dogwood) tests

Install bugfix/hydrometeors in a working copy of g-w PR #2875 on Dogwood. Find that the changes thus var in this PR are necessary but not sufficient for g-w CI C96C48_ufs_hybatmDA (i.e., JEDI DA) gdasanalcalc to run to completion.

Debugging found that changes are also needed in src/netcdf_io/calc_analysis.fd/inc2anl.f90

@@ -277,12 +277,14 @@ contains
           incncfile = open_dataset(incr_file, paropen=.true.)
           ! JEDI-derived increments have a time dimension, so read to appropriate array
           if ( jedi ) then
-             call read_vardata(incncfile, trim(incvar)//"_inc", work3d_inc_jedi, nslice=k, slicedim=3)
-             ! add increment to background
-             do j=1,nlat
-                jj=nlat+1-j ! increment is S->N, history files are N->S
-                work3d_bg(:,j,1) = work3d_bg(:,j,1) + work3d_inc_jedi(:,jj,1)
-             end do
+             if (has_var(incncfile, trim(incvar)//"_inc")) then
+                call read_vardata(incncfile, trim(incvar)//"_inc", work3d_inc_jedi, nslice=k, slicedim=3)
+                ! add increment to background, otherwise do nothing
+                do j=1,nlat
+                   jj=nlat+1-j ! increment is S->N, history files are N->S
+                   work3d_bg(:,j,1) = work3d_bg(:,j,1) + work3d_inc_jedi(:,jj,1)
+                end do
+             endif
           else
              call read_vardata(incncfile, trim(incvar)//"_inc", work3d_inc_gsi, nslice=k, slicedim=3)
              ! add increment to background
@@ -306,7 +308,7 @@ contains
       end do
       ! clean up and close
       if ( jedi ) then
-        deallocate(work3d_inc_jedi)
+        if (allocated(work3d_inc_jedi)) deallocate(work3d_inc_jedi)
       else
         deallocate(work3d_inc_gsi)
       end if

Able to get JEDI DA gdasanalcalc to run to completion with the above change in place. Need to examine output more carefully to ensure resulting output files are acceptable.

@RussTreadon-NOAA
Copy link
Contributor

Analysis file with the above changes to src/netcdf_io/calc_analysis.fd/inc2anl.f90 examined. Notice that omga is a new field in the background which is not processed by calc_anal.x. There are other variables in the background which are not analyzed but are replicated in the analysis file as the guess without an increment. Commit 5c8db46 follows this approach for omga. This aspect of 5c8db46 can be easily reverted. Other changes in 5c8db46 are necessary.

Adding @emilyhcliu as a reviewer to this PR. The changes in this PR are a follow on to modifications made in GSI-utils PR #46. @emilyhcliu , your thoughts on the changes in this PR would be much appreciated.

@DavidHuber-NOAA
Copy link
Collaborator

@CoryMartin-NOAA I tested the global workflow C96C48_ufs_hybatmDA case on Hera against commit 9efe71d and both the gdasanalcalc and gfsanalcalc jobs failed. A log is available here: /scratch1/NCEPDEV/global/David.Huber/para/COMROOT/gsiutil_fix_ufs/logs/2024022400/gdasanalcalc_9efe71d.log. I am going to pull in @RussTreadon-NOAA's commit at 5c8db46 and try again.

@DavidHuber-NOAA
Copy link
Collaborator

DavidHuber-NOAA commented Sep 12, 2024

The messages received for the crash occurred when attempting to add an increment for grle for the calc_analysis.x executable:

ensres_calc_anl OrderedDict([('setup', {'datapath': "'./'", 'analysis_filename': "'anl.ensres'", 'firstguess_filename': "'ges.ensres'", 'increment_filename': "'siginc.nc'", 'fhr': 6, 'jedi': '.true.'})])
srun -n 127 --verbose --export=ALL /scratch1/NCEPDEV/stmp2/David.Huber/RUNDIRS/gsiutil_fix_ufs/gdas.2024022400/analcalc.1207962/calcanl_ensres_06/calc_anl.x submitted
srun: warning: can't honor --ntasks-per-node set to 40 which doesn't match the requested tasks 127 with the number of requested nodes 4. Ignoring --ntasks-per-node.
srun: defined options
srun: -------------------- --------------------
srun: (null)              : h32m[02-03,12,44]
srun: cpus-per-task       : 1
srun: export              : ALL
srun: jobid               : 66460077
srun: job-name            : gsiutil_fix_ufs_gdasanalcalc_00
srun: mem                 : 48G
srun: nodes               : 4
srun: ntasks              : 127
srun: tres-per-task       : cpu:1
srun: verbose             : 1
srun: -------------------- --------------------
srun: end of defined options
srun: jobid 66460077: nodes(4):`h32m[02-03,12,44]', cpu counts: 40(x4)
srun: Implicitly setting --exact, because -c/--cpus-per-task given.
srun: CpuBindType=(null type)
srun: launching StepId=66460077.2 on host h32m02, 32 tasks: [0-31]
srun: launching StepId=66460077.2 on host h32m03, 32 tasks: [32-63]
srun: launching StepId=66460077.2 on host h32m12, 32 tasks: [64-95]
srun: launching StepId=66460077.2 on host h32m44, 31 tasks: [96-126]
srun: topology/tree: init: topology tree plugin loaded
srun: Node h32m44, 31 tasks started
srun: Node h32m02, 32 tasks started
srun: Node h32m03, 32 tasks started
srun: Node h32m12, 32 tasks started


* . * . * . * . * . * . * . * . * . * . * . * . * . * . * . * . * . * . * . * .
     PROGRAM CALC_ANALYSIS HAS BEGUN. COMPILED 2019300.00     ORG: EMC
     STARTING DATE-TIME  SEP 12,2024  01:14:49.502  256  THU   2460566


 Analysis File    = .//anl.ensres.06
 First Guess File = .//ges.ensres.06
 Increment File   = .//siginc.nc.06
 Forecast Hour    =            6
 Number of PEs    =          127
 input guess file and increment file should be in netCDF format
 writing analysis in netCDF format
 Use JEDI format  =  T
 Background initialization date=        2024           2          23          18
           0           0
 nlon=         192
 nlat=          96
 nlev=         127
 Analysis valid date=        2024           2          24           0
           0           0
 Copying from Background grid_xt
 Copying from Background grid_yt
 Copying from Background pfull
 Copying from Background phalf
 Adding Increment to clwmr  liq_wat
 Adding Increment to delz   delz
 Adding Increment to dpres  delp
 Copying from Background dzdt
 Adding Increment to grle   grle
 rank of data array != variable ndims (or ndims-1)
99
 rank of data array != variable ndims (or ndims-1)
 rank of data array != variable ndims (or ndims-1)
 rank of data array != variable ndims (or ndims-1)
 rank of data array != variable ndims (or ndims-1)
 rank of data array != variable ndims (or ndims-1)
 rank of data array != variable ndims (or ndims-1)
 rank of data array != variable ndims (or ndims-1)
...
srun: Received task exit notification for 31 tasks of StepId=66460077.2 (status=0x6300).
srun: error: h32m44: tasks 96-126: Exited with exit code 99
srun: Terminating StepId=66460077.2
slurmstepd: error: *** STEP 66460077.2 ON h32m02 CANCELLED AT 2024-09-12T01:14:52 ***
srun: Received task exit notification for 32 tasks of StepId=66460077.2 (status=0x6300).
srun: error: h32m03: tasks 32-63: Exited with exit code 99
srun: Received task exit notification for 32 tasks of StepId=66460077.2 (status=0x6300).
srun: error: h32m12: tasks 64-95: Exited with exit code 99
srun: Received task exit notification for 32 tasks of StepId=66460077.2 (status=0x6300).
srun: error: h32m02: tasks 0-31: Exited with exit code 99

@DavidHuber-NOAA
Copy link
Collaborator

@RussTreadon-NOAA @CoryMartin-NOAA The job now runs to completion. Apologies for not reading the entirety of your debugging efforts, Russ.

jj=nlat+1-j ! increment is S->N, history files are N->S
work3d_bg(:,j,1) = work3d_bg(:,j,1) + work3d_inc_jedi(:,jj,1)
end do
if (has_var(incncfile, trim(incvar)//"_inc")) then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this check if specific variables are missing, similar to how interp_inc now allows for only the hydrometeors to be missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

One could limit this check to the specific hydrometeors flagged in the revised driver.F90. A more general approach was taken here to exclude all variables for which no increment is found. What approach shall we take? Thoughts @CatherineThomas-NOAA , @emilyhcliu , @CoryMartin-NOAA

Copy link
Contributor

@emilyhcliu emilyhcliu Sep 12, 2024

Choose a reason for hiding this comment

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

The best way is probably to relate the required increments from the state variable table in anavinfo. This requires a bit more coding and related script changes. For now, the proposed change should work and be acceptable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you @emilyhcliu for your suggestion. I agree with you. We can stick with the easier solution for the time being.

Copy link
Contributor

Choose a reason for hiding this comment

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

Logical variable readinc added to improve runtime printout. When a JEDI increment file is processed and a specified increment field is not present readinc is set to .false.. The calling routine uses the jedi logical along with readinc to select the appropriate runtime message. If the increment is added to the background the runtime printout is, for example,

nid002740.dogwood.wcoss2.ncep.noaa.gov 0:  Adding Increment to spfh   sphum
nid002740.dogwood.wcoss2.ncep.noaa.gov 0:  Adding Increment to tmp    T
nid002740.dogwood.wcoss2.ncep.noaa.gov 0:  Adding Increment to ugrd   u

Otherwise the printout is

nid002740.dogwood.wcoss2.ncep.noaa.gov 0:  Copying from Background grle
nid002740.dogwood.wcoss2.ncep.noaa.gov 0:  Copying from Background rwmr
nid002740.dogwood.wcoss2.ncep.noaa.gov 0:  Copying from Background snmr

Previously, even though JEDI increments for grle, rwmr, and snmr were not available, the runtime printout was

nid001756.dogwood.wcoss2.ncep.noaa.gov 0:  Adding Increment to grle   grle
nid001756.dogwood.wcoss2.ncep.noaa.gov 0:  Adding Increment to rwmr   rwmr
nid001756.dogwood.wcoss2.ncep.noaa.gov 0:  Adding Increment to snmr   snmr

This change committed at 1c512a1.

src/netcdf_io/calc_analysis.fd/inc2anl.f90 Show resolved Hide resolved
@RussTreadon-NOAA
Copy link
Contributor

WCOSS2 (Dogwood) parallel tests

We do not have ctests or CI for GSI-utils applications.

In lieu of this, g-w CI

  • C96C48_hybatmDA: GSI-based DA
  • C96C48_ufs_hybatmDA: JEDI-based DA
  • C96C48_hybatmaerosnowDA: GSI & JEDI DA for different components

has been run on Dogwood. bugfix/hydrometeors at 5c8db46 was used to populate sorc/gsi_utils.fd in these g-w CI tests.

gfs and gdas analcalc jobs from each g-w CI configuration successfully ran to completion.

@CatherineThomas-NOAA
Copy link
Contributor

@XiaqiongZhou-NOAA: For the new omega calculation, should the omga field also be included in the gaussian analysis file (gfs/gdas.tHHz.atmanl.nc)? Note that the DA will not produce an analysis increment for this field, it would simply be a copy of the model output.

@RussTreadon-NOAA
Copy link
Contributor

Thank you @CatherineThomas-NOAA for your help!

@XiaqiongZhou-NOAA
Copy link

XiaqiongZhou-NOAA commented Sep 12, 2024

@XiaqiongZhou-NOAA: For the new omega calculation, should the omega field also be included in the gaussian analysis file (gfs/gdas.tHHz.atmanl.nc)? Note that the DA will not produce an analysis increment for this field, it would simply be a copy of the model output.

@CatherineThomas-NOAA
omega is included in history file and used for the post-process. It seems to me no use of omega in analysis files.

@CatherineThomas-NOAA
Copy link
Contributor

omega is included in history file and used for the post-process. It seems to me no use of omega in analysis files.

Thanks @XiaqiongZhou-NOAA. Is "omga" in atmanl needed for the creation of pgbanl? Tagging @WenMeng-NOAA as well.

@RussTreadon-NOAA
Copy link
Contributor

g-w CI tests on Hercules

Check 1 - does bugfix/hydrometeors run?

bugfix/hydrometeors @ 1c512a1 has been installed on Hercules inside g-w feature/radbcor (see g-w PR #2875).

g-w CI for C96C48_hybatmDA, C96C48_ufs_hybatmDA, and C96C48_hybatmaerosnowDA has been run. All jobs for each configuration successfully run to completion. In particular, gdas and gfs analcalc jobs run with out error. This is especially important for C96C48_ufs_hybatmDA (JEDI-based DA) which previously failed.

Check 2 - do atmanl or atmanl.ensres files change?

As a second check resinstall sorc/gsi_utils.fd using GSI-utils develop at 9382fd0. This is the hash g-w develop current points at. Rerun the above g-w CI tests. Compare analysis files from this set of runs (control) and g-w CI run with `bugfix/hydrometeors' (update)

For all three g-w CI configurations the atmanl.nc files differ in the the control file has missing values for nccice, nconrd, and omga. For example, the _C96C48_hybatmDA (GSI-based DA) control atmanl.nc file for 20211221 06Z has

nccice min= -- , max= -- , mean= --
nconrd min= -- , max= -- , mean= --
o3mr min= -7.221842e-09 , max= 1.690479e-05 , mean= 1.9921804e-06
omga min= -- , max= -- , mean= --

whereas the update only has missing values for omga

nccice min= 0.0 , max= 13468460.0 , mean= 12457.897
nconrd min= 0.0 , max= 9999.673 , mean= 11.921346
o3mr min= -7.221842e-09 , max= 1.690479e-05 , mean= 1.9921804e-06
omga min= -- , max= -- , mean= --

All other fields in the two sets of atmanl.nc files are identical. This difference is not due to this PR. nccice and ncondrd were added to src/netcdf_io/calc_analysis.fd/inc2anl.f90 via PR #46. Neither of these fields are, at present, analyzed by the GSI. calc_analysis.x built from bugfix/hydrometeors (this PR) writes the message

 Copying from Background nccice
 Copying from Background nconrd

to the job log file to note the fact that the nccice and nconrd fields in atmanl.nc are actually just the background.

The atmanl.ensres.nc files are bitwise identical between the control and update for all g-w configurations.

Unless reviewers have additional requests, the changes in this PR are ready for final review, approval, and merger into GSI-utils develop.

@RussTreadon-NOAA
Copy link
Contributor

Any more changes or testing you want to see @DavidHuber-NOAA or @emilyhcliu? If not would you please approve this PR. I'll merge into develop once the PR is approved.

Copy link
Collaborator

@DavidHuber-NOAA DavidHuber-NOAA left a comment

Choose a reason for hiding this comment

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

Changes look good. Thanks @RussTreadon-NOAA @CoryMartin-NOAA!

@RussTreadon-NOAA
Copy link
Contributor

Thank you @DavidHuber-NOAA for your review and approval

@XiaqiongZhou-NOAA
Copy link

omega is included in history file and used for the post-process. It seems to me no use of omega in analysis files.

Thanks @XiaqiongZhou-NOAA. Is "omga" in atmanl needed for the creation of pgbanl? Tagging @WenMeng-NOAA as well.

@CatherineThomas-NOAA , Good question. If omga is included in pgbanl, it is still needed in atmanl. same question to @WenMeng-NOAA

@emilyhcliu
Copy link
Contributor

g-w CI tests on Hercules

Check 1 - does bugfix/hydrometeors run?

bugfix/hydrometeors @ 1c512a1 has been installed on Hercules inside g-w feature/radbcor (see g-w PR #2875).

g-w CI for C96C48_hybatmDA, C96C48_ufs_hybatmDA, and C96C48_hybatmaerosnowDA has been run. All jobs for each configuration successfully run to completion. In particular, gdas and gfs analcalc jobs run with out error. This is especially important for C96C48_ufs_hybatmDA (JEDI-based DA) which previously failed.

Check 2 - do atmanl or atmanl.ensres files change?

As a second check resinstall sorc/gsi_utils.fd using GSI-utils develop at 9382fd0. This is the hash g-w develop current points at. Rerun the above g-w CI tests. Compare analysis files from this set of runs (control) and g-w CI run with `bugfix/hydrometeors' (update)

For all three g-w CI configurations the atmanl.nc files differ in the the control file has missing values for nccice, nconrd, and omga. For example, the _C96C48_hybatmDA (GSI-based DA) control atmanl.nc file for 20211221 06Z has

nccice min= -- , max= -- , mean= --
nconrd min= -- , max= -- , mean= --
o3mr min= -7.221842e-09 , max= 1.690479e-05 , mean= 1.9921804e-06
omga min= -- , max= -- , mean= --

whereas the update only has missing values for omga

nccice min= 0.0 , max= 13468460.0 , mean= 12457.897
nconrd min= 0.0 , max= 9999.673 , mean= 11.921346
o3mr min= -7.221842e-09 , max= 1.690479e-05 , mean= 1.9921804e-06
omga min= -- , max= -- , mean= --

All other fields in the two sets of atmanl.nc files are identical. This difference is not due to this PR. nccice and ncondrd were added to src/netcdf_io/calc_analysis.fd/inc2anl.f90 via PR #46. Neither of these fields are, at present, analyzed by the GSI. calc_analysis.x built from bugfix/hydrometeors (this PR) writes the message

 Copying from Background nccice
 Copying from Background nconrd

to the job log file to note the fact that the nccice and nconrd fields in atmanl.nc are actually just the background.

The atmanl.ensres.nc files are bitwise identical between the control and update for all g-w configurations.

Unless reviewers have additional requests, the changes in this PR are ready for final review, approval, and merger into GSI-utils develop.

@RussTreadon-NOAA The test results look good to me. Especially, the nice and ncornd should be filled with background values for the updated case.

Copy link
Contributor

@emilyhcliu emilyhcliu left a comment

Choose a reason for hiding this comment

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

The code changes look good to me.
@RussTreadon-NOAA Thank you for performing the tests, documenting them in detail, and adding the extra output lines to make it clear that the fields are copied from the background for fields with no increment (not analysis variables).
The omga is new to me. If there is no increment to this field, but it is included in the analysis file, it should be filled with background for consistency and clarity, especially; if the downstream processing (e.g., post) needs it.

@RussTreadon-NOAA
Copy link
Contributor

@WenMeng-NOAA , @XiaqiongZhou-NOAA , and @CatherineThomas-NOAA . $WGRIB2 of operational pgrb2.0p25.anl returns VVEL on pressure surfaces. A check of the 20211221 gdas.t06z.pgrb2.0p25.anl from g-w CI C96C48_hybatmDA also returns VVEL on pressure surfaces. For g-w CI C96C48_hybatmDA how is VVEL in the pgbanl file computed?

@RussTreadon-NOAA
Copy link
Contributor

The code changes look good to me. @RussTreadon-NOAA Thank you for performing the tests, documenting them in detail, and adding the extra output lines to make it clear that the fields are copied from the background for fields with no increment (not analysis variables). The omga is new to me. If there is no increment to this field, but it is included in the analysis file, it should be filled with background for consistency and clarity, especially; if the downstream processing (e.g., post) needs it.

Thank you @emilyhcliu for your comments and approval. I agree. We need to figure out the best way to handle omga before we can close this PR.

@WenMeng-NOAA
Copy link

WenMeng-NOAA commented Sep 16, 2024

The code changes look good to me. @RussTreadon-NOAA Thank you for performing the tests, documenting them in detail, and adding the extra output lines to make it clear that the fields are copied from the background for fields with no increment (not analysis variables). The omga is new to me. If there is no increment to this field, but it is included in the analysis file, it should be filled with background for consistency and clarity, especially; if the downstream processing (e.g., post) needs it.

Thank you @emilyhcliu for your comments and approval. I agree. We need to figure out the best way to handle omga before we can close this PR.

The upp first reads 'omga' from model analysis/forecast. If it is not found, 'omga' will be calculated using 'W' in UPP.

@RussTreadon-NOAA
Copy link
Contributor

Thank you @WenMeng-NOAA for your reply. What does UPP do if atmanl.nc contains netcdf missing values for omga? Will UPP detect the missing values and compute omga from W?

@WenMeng-NOAA
Copy link

Thank you @WenMeng-NOAA for your reply. What does UPP do if atmanl.nc contains netcdf missing values for omga? Will UPP detect the missing values and compute omga from W?

@RussTreadon-NOAA UPP detects if 'dzdt' is missing from 'atmanl.nc'. If 'dzdt' is found, calculating omga in UPP. Please see the code here

@XiaqiongZhou-NOAA
Copy link

The code changes look good to me. @RussTreadon-NOAA Thank you for performing the tests, documenting them in detail, and adding the extra output lines to make it clear that the fields are copied from the background for fields with no increment (not analysis variables). The omga is new to me. If there is no increment to this field, but it is included in the analysis file, it should be filled with background for consistency and clarity, especially; if the downstream processing (e.g., post) needs it.

Thank you @emilyhcliu for your comments and approval. I agree. We need to figure out the best way to handle omga before we can close this PR.

The upp first reads 'omga' from model analysis/forecast. If it is not found, 'omga' will be calculated using 'W' in UPP.

@RussTreadon-NOAA
Wen is right, 'omga' can be calculated in UPP, but it should be directedly from the model output since the calculation method in UPP is not accurate enough. 'omga' should be included in atmanl. My previous thought about not-including-'omga'-in-atmanl' does not think of the need for pgbanl.

@RussTreadon-NOAA
Copy link
Contributor

Thank you @WenMeng-NOAA and @XiaqiongZhou-NOAA.

At present neither GSI nor JEDI based DA analyze omga. calc_analysis.x built from both develop and bugfix/hydrometeors currently populates atmanl.nc omga with the netcdf missing value`.

        float omga(time, pfull, grid_yt, grid_xt) ;
                omga:_FillValue = 9.99e+20f ;
                omga:cell_methods = "time: point" ;
                omga:long_name = "Vertical pressure velocity" ;
                omga:missing_value = 9.99e+20f ;
                omga:output_file = "atm" ;
                omga:units = "pa/sec" ;

...

data:

 omga =
  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 
    _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 

Sounds like the behavior you would like to see is for calc_analysis.x to write the background omga to atmanl.nc. This can be done (and was done in an earlier hash of bugfix/hydrometeors). The problem here is that the background omga will not be consistent with GSI or JEDI analyzed fields. If users are unaware of this, they could get confused / be misled when they examine what they think are analysis fields.

@CatherineThomas-NOAA
Copy link
Contributor

Thanks for running those thorough tests, @RussTreadon-NOAA.

The problem here is that the background omga will not be consistent with GSI or JEDI analyzed fields. If users are unaware of this, they could get confused / be misled when they examine what they think are analysis fields.

I agree that I'm not a fan of non-analyses being in the analysis file, but this is already the case for other variables like dzdt. Having omga be a copy of the background would make it consistent with dzdt as well as having the same omga calculation for the pgbanl and pgbfFFF files.

@RussTreadon-NOAA
Copy link
Contributor

Hercules tests

Install g-w PR #2875 on Hercules. g-w currently points at GSI-utils at gsi_utils.fd @ 9382fd0.

Set up and run GSI-based DA using C96C48_hybatmDA and JEDI-based DA using C96C48_ufs_hybatmDA. Rerun gdasanalcalc three times. The first run used the GSI-utils g-w currently points at. The second run moved to the current head of GSI-utils develop. The last run used GSI-utils from the current head bugfix/hydrometeors

The table below shows the omga value in the atmanl.nc file from each run of gdasanalcalc.

gsi_utils.fd @ 9382fd0 GSI-utils develop @ bb0138d GSI-utils bugfix/hydrometeors @ 2f38004
GSI-based DA, 20211221 06Z omga min= -- , max= -- , mean= -- omga min= -- , max= -- , mean= -- omga min= -3.0486908 , max= 1.8343604 , mean= 0.0023971628
JEDI-based DA, 20240224 00Z no omga in atmanl.nc gdasanalcalc aborts omga min= -3.8455164 , max= 1.5482693 , mean= -0.00017994264

The final column exhibits the desired behavior. The atmanl.nc omga is the background value. With the other GSI-utils hashes we get no omga in atmanl.nc, all missing values for omga, or gdasanalcalc aborts.

@CatherineThomas-NOAA , @XiaqiongZhou-NOAA , @WenMeng-NOAA , @emilyhcliu , @DavidHuber-NOAA , @CoryMartin-NOAA , unless anyone objects, I plan on merging this PR in its current state into GSI-utils develop before COB today (9/17/2024).

Copy link
Collaborator

@DavidHuber-NOAA DavidHuber-NOAA left a comment

Choose a reason for hiding this comment

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

I ran this through the gdasanalcalc job for three cycles a JEDI-based experiment without issue then was able to run the follow-on gdasanlupp job without issue. Changes look good to me as well. Approve.

@RussTreadon-NOAA
Copy link
Contributor

Thank you @DavidHuber-NOAA for testing the revised code. I'll go ahead and merge into develop.

Copy link
Contributor

@RussTreadon-NOAA RussTreadon-NOAA left a comment

Choose a reason for hiding this comment

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

Approve.

@RussTreadon-NOAA RussTreadon-NOAA merged commit a6ea311 into develop Sep 17, 2024
8 checks passed
@RussTreadon-NOAA RussTreadon-NOAA deleted the bugfix/hydrometeors branch September 17, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants