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

Adding code to analyze the siginificant wave heigh in GSI 3D Analysis (see issue #601) #614

Merged
merged 12 commits into from
Sep 29, 2023
Merged

Adding code to analyze the siginificant wave heigh in GSI 3D Analysis (see issue #601) #614

merged 12 commits into from
Sep 29, 2023

Conversation

GangZhao-NOAA
Copy link
Contributor

@GangZhao-NOAA GangZhao-NOAA commented Aug 24, 2023

Adding code to analyze the siginificant wave heigh in GSI 3D Analysis, esp. for FV3-LAM model based DA, eg. RRFS-DA, RRFS-3DRTMA. (Also see the issue in EMC GSI github repository: #601
Adding I/O for Analysis of Significant Wave Height for 3DRTMA)

Description

Significant Wave Height (hereafter as SWH) is one of the standard products provided by the operational (2D)RTMA. To continuously provide the same products in 3DRTMA, the next-generation RTMA, some efforts in GSI code need to be made in order to analyze the SWH in 3D analysis of GSI.

The kernel subroutines to assimilate SWH in GSI (such as stphowv.f90, setuphowv.f90, inthowv.f90, gsi_howvOper.f90 and m_howvNode.f90) already had been added for (2D)RTMA years ago by Manuel Pondeca, so for this issue, the code work mainly focus on adding the I/O of SWH in background and analysis fields for 3DRTMA (esp. RRFS-based 3DRTMA), and some necessary modifications in background error, options, variables related to analysis of SWH, etc.
Modified code in GSI:

  1. rapidrefresh_cldsurf_mod.f90: adding a few variables related to the analysis of howv in 3D analysis
  2. gsimod.F90: adding namelist options used for analysis of howv in 3D analysis
  3. m_berror_stats_reg.f90: added some code for the special treatment to the static background error (BE) of howv
  4. read_prepbufr.f90: adding code to decode the observation of howv in prepbufr file when howv is available in firstguess
  5. setuphowv.f90: adding code to use obs of howv when howv is available in firstguess
  6. gsi_rfv3io_mod.f90: adding I/O code to read in howv from firstguess and write out howv into analysis.

No dependencies are required for this change.

This PR is addressing the issue #601: Adding code to analyze the siginificant wave heigh in GSI 3D Analysis".

Fixes #601

Type of change

Please delete options that are not relevant.

  • [*] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Brief results from ctest (regression test) with the modified code (on WCOSS2 - Cactus):

[gang.zhao@clogin07:build] (feature/3drtma_howv)$ ctest -N
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Test #1: global_3dvar
Test #2: global_4dvar
Test #3: global_4denvar
Test #4: hwrf_nmm_d2
Test #5: hwrf_nmm_d3
Test #6: rtma
Test #7: rrfs_3denvar_glbens
Test #8: netcdf_fv3_regional
Test #9: global_enkf

Total Tests: 9
Test #1: global_3dvar
[gang.zhao@clogin04:build] (feature/3drtma_howv)$ ctest -R global_3dvar
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 1: global_3dvar
1/1 Test #1: global_3dvar ..................... Passed 1631.12 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 1631.14 sec

Test #2: global_4dvar
[gang.zhao@clogin09:build] (feature/3drtma_howv)$ ctest -R global_4dvar
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 2: global_4dvar
1/1 Test #2: global_4dvar ..................... Passed 2462.19 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 2462.23 sec

Test #3: global_4denvar
[gang.zhao@clogin04:build] (feature/3drtma_howv)$ ctest -R global_4denvar
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 3: global_4denvar
1/1 Test #3: global_4denvar ................... Passed 1922.43 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 1922.46 sec

Test #4: hwrf_nmm_d2
[gang.zhao@clogin09:build] (feature/3drtma_howv)$ ctest -R hwrf_nmm_d2
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 4: hwrf_nmm_d2
1/1 Test #4: hwrf_nmm_d2 ...................... Passed 1214.10 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 1214.20 sec

Test #5: hwrf_nmm_d3
[gang.zhao@clogin09:build] (feature/3drtma_howv)$ ctest -R hwrf_nmm_d3
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 5: hwrf_nmm_d3
1/1 Test #5: hwrf_nmm_d3 ...................... Passed 736.38 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 736.50 sec

Test #6: rtma
[gang.zhao@clogin05:build] (feature/3drtma_howv)$ ctest -R rtma
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 6: rtma
1/1 Test #6: rtma ............................. Passed 1027.01 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 1027.01 sec

Test #7: rrfs_3denvar_glbens
[gang.zhao@clogin06:build] (feature/3drtma_howv)$ ctest -R rrfs_3denvar_glbens
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 7: rrfs_3denvar_glbens
1/1 Test #7: rrfs_3denvar_glbens .............. Passed 484.69 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 484.70 sec

Test #8: netcdf_fv3_regional
[gang.zhao@clogin03:build] (feature/3drtma_howv)$ ctest -R netcdf_fv3_regional
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 8: netcdf_fv3_regional
1/1 Test #8: netcdf_fv3_regional .............. Passed 483.08 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 483.11 sec

Test #9: global_enkf
[gang.zhao@clogin03:build] (feature/3drtma_howv)$ ctest -R global_enkf
Test project /lfs/h2/emc/da/save/gang.zhao/WorkDir/WaveHgt/develop/build
Start 9: global_enkf
1/1 Test #9: global_enkf ...................... Passed 488.50 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 488.57 sec

  • The modified GSI code passed the regression tests (all 9 tasks) on Hera and WCOSS2 (Cactus).

  • adding the analysis of howv only has very trial influences on the analyses of other variables. Here is the statistics of the differences of other variables (u/v/t/ps/q/t2m/q2m) from the runs of GSI without howv vs. with howv (from a testing case 2023-07-12_14:00:00 UTC in 3km North-American domain):

comparing two netcdf files: fcst_fv3lam_hyb_betas/INPUT/fv_core.res.tile1.nc fcst_fv3lam_nodata_noinfo/INPUT/fv_core.res.tile1.nc ...
Variable Group Count Sum AbsSum Min Max Range Mean StdDev
u / 602135550 3926.84 25760.8 -0.1026 0.485788 0.588388 6.52152e-06 0.00115817
v / 620166777 -4891.34 32582.5 -0.835774 0.268402 1.10418 -7.88714e-06 0.00197793
T / 155987083 178.048 6497.51 -0.0246582 0.0384064 0.0630646 1.14143e-06 0.000218737
delp / 19559676 -281.532 3008.29 -0.00292969 0.00219727 0.00512695 -1.43935e-05 0.000183727

comparing two netcdf files: fcst_fv3lam_hyb_betas/INPUT/fv_tracer.res.tile1.nc fcst_fv3lam_nodata_noinfo/INPUT/fv_tracer.res.tile1.nc ...
Variable Group Count Sum AbsSum Min Max Range Mean StdDev
sphum / 430707614 0.594287 2.77816 -2.6139e-05 3.1759e-05 5.7898e-05 1.37979e-09 8.03072e-08

comparing two netcdf files: fcst_fv3lam_hyb_betas/INPUT/sfc_data.nc fcst_fv3lam_nodata_noinfo/INPUT/sfc_data.nc ...
Variable Group Count Sum AbsSum Min Max Range Mean StdDev
t2m / 10665000 43.3899 135.095 -0.00152825 0.00686629 0.00839454 4.06844e-06 5.02866e-05
q2m / 10665000 0.0192553 0.124707 -3.1476e-06 1.77554e-05 2.0903e-05 1.80547e-09 5.89657e-08

It could be seen that the differences are trivial and ignorable.

The regression tests were done by following the instructions of "GSI Ctests (regression tests)" in GSI Wiki

The modified code had also been tested with a testing case 2023-07-12_14:00:00 UTC for 3km North-American domain
Here is a brief summary of the test results:

  1. Here is the analysis increment of Significant Wave Height (aka howv hereafter): pure 3dvar, static background error of howv is 0.42 meters, and the de-correlation length scale is 170km.
    HOWV_var_inc_maprll_datll_reg_ncf
  2. The following figure shows the distribution of howv in the analysis (used obs is in green, rejected in red). Obviously the location of used obs of howv match the area of non-zero analysis increments of howv.
    var_obs_2023071214_howv_maprll_datll_reg_ncf
  3. The following figure is the analysis increment of howv with hybrid envar analysis (using gdas ensemble 80 members and the ensemble weight is 84%), and the static BE of howv is tuned/inflated. The analysis increments are very similar to the results from pure 3dvar run (see the first figure)
    HOWV_hyb_betas016_inc_maprll_datll_reg_ncf
  4. The last figure shows the analysis increments of howv with hybrid envar analysis (using gdas ensemble 80 members and the ensemble weight is 84%), but the static BE of howv is NOT tuned. It can be observed that the analysis increments is less than the results from the hybrid run with tuning the static BE of howv. That is because the weight of static BE (16%) reduced the background error of howv (ensemble of howv is not available yet), so the impact of obs is decreased.
    HOWV_hyb_betas016_noTune_inc_maprll_datll_reg_ncf

Checklist

  • [*] My code follows the style guidelines of this project
  • [*] I have performed a self-review of my own code
  • [*] I have commented my code, particularly in hard-to-understand areas
  • [*] New and existing tests pass with my changes
  • [*] Any dependent changes have been merged and published

DUE DATE for this PR is 10/5/2023. If this PR is not merged into develop by this date, the PR will be closed and returned to the developer.

esp. for FV3-LAM model based DA, eg. RRFS-DA, RRFS-3DRTMA.
(Also see the issue in EMC GSI github repository: #601
 Adding I/O for Analysis of Significant Wave Height for 3DRTMA)
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
src/gsi/read_prepbufr.f90 Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
Copy link
Contributor

@guoqing-noaa guoqing-noaa left a comment

Choose a reason for hiding this comment

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

A general comment:
I would suggest we drop the two interval variables: i_howv_in_data and i_howv_in_anav

Whether to read howv observations should be solely determined by user setting in the OBS_INPUT section of gsiparm.anl

Whether to read howv from first guess should be solely determined by user settings in the anavinfo file. If user wants howv but the first guess does not have this field, GSI should stop at this critical error.

src/gsi/setuphowv.f90 Outdated Show resolved Hide resolved
@GangZhao-NOAA
Copy link
Contributor Author

@guoqing-noaa @TingLei-NOAA @hu5970 ,
As a reply to Guoqing Ge's general comment (see #614 (review))

A general comment: I would suggest we drop the two interval variables: i_howv_in_data and i_howv_in_anav

I still incline to keep i_howv_in_anav and i_howv_in_data in current version of code to analyze howv in 3D GSI analysis. The explanation will be addressed in this comment.

Whether to read howv observations should be solely determined by user setting in the OBS_INPUT section of gsiparm.anl

Yes, I agree. It was indeed done by adding at least the following two lines in the "OBS_INPUT section of gsiparm.anl"
prepbufr howv null howv 1.0 0 0
satmar howv null howv 1.0 0 0

Whether to read howv from first guess should be solely determined by user settings in the anavinfo file. If user wants howv but the first guess does not have this field, GSI should stop at this critical error.

Yes, as you mentioned "determined by user settings in the anavinfo file", for this reason, the variable "i_howv_in_data" is introduced here. If howv is in anavinfo file, i_howv_in_data = 1, otherwise as 0. Then there are several places in the I/O subroutines, i_howv_in_data is used to set the guess bundle array ges_howv.

As for "If user wants howv but the first guess does not have this field, GSI should stop at this critical error", yes and no.
Yes: it is reasonable if no howv in background, the analysis of howv should stop.
No: 3DRTMA is not just analysis of howv, HOWV is just one of the operational RTMA products. There are a bunch of essential products, such as, 10-m wind, 2-m T and Td, surface pressure, visibility and cloud ceiling height, etc, which are in hourly, even sub-hourly demands. In operational practices, if in case that WW3 system was crashed and no background for howv, but RRFS-DA system still ran very well and could provide all other firstguess data for 3DRTMA, we can not afford to stop GSI and cancel all the essential downstream products.

The variable "i_howv_in_data" was not introduced into analysis of howv in the beginning stage of code development. I made a test run, in that test run, there is howv in the anavinfo, and howv is also set in namelist, the obs file of howv are also copied, but there is NO howv in the firstguess file. Then I let GSI run. The interesting thing is that GSI did NOT crash (as you mentioned in another comment: in init_vars_ of setuphowv, if no firstguess, then GSI should stop), and GSI still ran with howv in cost function, in outer-loop and inner-loop of minimisation. I mean the essential part of GSI analysis was done, GSI was running almost to the end, then it just hung there until the wall-clock time limit was reached and the job was killed. Later I found that GSI was stuck in the step to output the analysis of "howv" into original firstguess file but actually howv was not in firstguess. But GSI did not give out any error message and information, just hung up there.
So this is one of the motivations to introduce "i_howv_in_data", in case that if howv is already set in anavinfo and namelist, but there is no howv in firstguess, then GSI would not call the subroutine to output howv, so there would be no such "job hung-up" accident.

Thanks,

@guoqing-noaa
Copy link
Contributor

@GangZhao-NOAA

Thanks for your efforts including howv in the 3D regional applications and thanks for lots of great discussions. I now get a better understanding of your considerations. And my thoughts are updated as follows:

The behavior of howv in 3DDA is different that of t2m/q2m. It requires adding new entries to "met_guess", "state_vector" and "control_vector" in anavinfo. So the behavior of howv is similar as, for example, aerosol DA. In this sense, I would suggest we add a top level parameter in gsiparm.anl to control whether and how to do howv in 3DDA. We may add "l_howv_3DDA" to turn on/off. Or we may add "i_howv_3DDA" with 0= no howv in 3D DA; 1= howv in 3DDA with default settings; 2=howv in 3DDA with static BE scaled in a hybrid 3DEnVAR setting. I would hope this will simplify the overall logic and avoid the use of two internal flags "i_howv_in_anav" and "i_howv_in_data"

As to "corp_howv" and "hwllp_howv", since you already developed these new options, we can keep them if you like. I think it will be a good addition. In this situation, we may want to introduce a new namelist section, such as "&HOWV_3DDA" (similar to, for example, &CHEM), to host all howv_3DDA related parameters (such as i_howv_3DDA, corp_howv, hwllp_howv, etc). However, I think it is also fine to put all those new parameters in the &RAPIDREFRESH_CLDSURF namelist section. Thanks!

@GangZhao-NOAA
Copy link
Contributor Author

GangZhao-NOAA commented Sep 1, 2023 via email

@guoqing-noaa
Copy link
Contributor

guoqing-noaa commented Sep 1, 2023 via email

(howv) in 3D analysis, based on feedbacks from code reviewers.
for significant wave height:
  1) combine two variables i_howv_in_anav and i_howv_in_data into one
variable i_howv_3dda
  2) if howv is required in analyis (as set howv in anavinfo), but if howv
is not available in firstguess, then stop GSI run.
  3) removing the code which tunes the static BE of howv in hybrid envar
run. So in hybrid run, user needs to set the corp_howv in namelist if
desired.
  4) cleaning some unnecessary comments
Copy link
Contributor

@guoqing-noaa guoqing-noaa left a comment

Choose a reason for hiding this comment

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

Hi, @GangZhao-NOAA Thanks a lot for making the changes!

src/gsi/rapidrefresh_cldsurf_mod.f90 Show resolved Hide resolved
src/gsi/rapidrefresh_cldsurf_mod.f90 Show resolved Hide resolved
src/gsi/m_berror_stats_reg.f90 Outdated Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Show resolved Hide resolved
src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
@GangZhao-NOAA
Copy link
Contributor Author

GangZhao-NOAA commented Sep 19, 2023 via email

@GangZhao-NOAA
Copy link
Contributor Author

Hi @guoqing-noaa, @TingLei-NOAA @hu5970, @MatthewMorris-NOAA, @ManuelPondeca-NOAA @GangZhao-NOAA,

Based on recent comments and suggestions from your code review, the code was modified and committed. Could you please take some time to review the updated code (commit #7888831)? The updates include clean-off of some unnecessary comments, not-used variables (iret_howv, l_hyb_ens, etc,) and one typo.

There is one suggestion from Guoqing (@guoqing-noaa) -- "I would suggest making i_howv_in_3dda a tuning parameter in a GSI namelist". Manuel and I discussed on it, and Manuel pointed out that, if howv is added in anavinfo, esp. added as state vector and control vector, howv would be analyzed, even user sets "i_howv_3dda=0" and wants to turn it off. This would be a problem.

Actually I did make out a version with "i_howv_3dda as top-level namelist option" following Guoqing's suggestion. The code is under branch "feature/3drtma_howv_nmls4gge" of my fork of GSI. And I did test it with "howv in anavinfo, howv in firstguess and howv in obs, but i_howv_3dda=0". It was expected that howv should not be analyzed, but actually it was included in the cost function and the minimization. Even it was NOT updated at final step (since i_howv_3dda=0), but it already influenced the minimization, then user would not get the exact results as expected. For the test results with version using "i_howv_3dda as namelist option", it could be found on Hera under "/scratch2/NCEPDEV/stmp1/Gang.Zhao/3drtma/rtma.v0.3.1_howv/stmp/2023071214/nmls4gge/":

GSI running directory"anal_conv_gsi_yesdata_yesinfo_nonmls_4gge/": where you could see the anavinfo/convinfo/gsiparm.anl which have "howv" set up in them, but "i_howv_3dda=0" is set in gsiparm.anl. Then in the output log file "stdout", it could be found that as following:

 Begin J table inner/outer loop           0           1
     J term                                     J
surface pressure             6.5923881160443067E+04
temperature                  2.4501224952754081E+05
wind                         6.5961498862121109E+04
moisture                     2.2165619957124614E+05
radial wind                  2.6822828481705956E+03
precipitable water           4.2245348004824490E+02
**_howv                         7.7013888888888896E+03_**
...
...
 update_guess: successfully complete
increment u                     -5.166633235802E-04  -1.201972126224E+01   1.982600147161E+01
...
increment sst                    0.000000000000E+00   0.000000000000E+00   0.000000000000E+00
**_increment howv                   1.201356552850E-01  -3.476099656462E-03   1.220824654190E+00_**

Obviously howv interferes with the computation of cost and gradient.
But the howv field in firstguess file is NOT updated (since i_howv_3dda=0).
Under the directory "fcst_fv3lam_yesdata_yesinfo_nonmls_4gge/INPUT/", by comparing the the firstguess "bk_sfc_data.nc" vs the analysis "sfc-data.nc". it could be found that, t2m/q2m are updated, but howv in two files are identical.

[Gang.Zhao@hfe09:INPUT]$ nccmp -q -d -s -S -f -F -v t2m bk_sfc_data.nc  sfc_data.nc
Variable Group    Count          Sum      AbsSum      Min     Max   Range      Mean   StdDev
t2m      /     10665000 -1.43496e+06 2.30472e+06 -11.1263 6.52609 17.6524 -0.134549 0.345846
[Gang.Zhao@hfe09:INPUT]$ nccmp -q -d -s -S -f -F -v q2m bk_sfc_data.nc  sfc_data.nc
Variable Group    Count      Sum  AbsSum         Min        Max     Range         Mean      StdDev
q2m      /     10665000 -1028.36 1550.44 -0.00961218 0.00529107 0.0149032 -9.64235e-05 0.000278589
[Gang.Zhao@hfe09:INPUT]$ nccmp -q -d -s -S -f -F -v howv bk_sfc_data.nc  sfc_data.nc
Files "bk_sfc_data.nc" and "sfc_data.nc" are identical.

So based on this and other considerations, we still suggest NOT set "i_howv_3dda" as a top-level namelist option (at least for now, it interested, we can revisit this topic by initiating another issue later).

Thanks,

-Gang

@GangZhao-NOAA
Copy link
Contributor Author

GangZhao-NOAA commented Sep 22, 2023

The recently-updated code (commit #7888831) also passed the regression test (all 9 tasks) on Hera. Here are a brief test result:
(under "/scratch1/NCEPDEV/da/Gang.Zhao/noscrub/regression")

[Gang.Zhao@hfe09:build] (feature/3drtma_howv)$ ctest -j 9
Test project /scratch1/NCEPDEV/da/Gang.Zhao/ProdGSI_dev/emcGSI_howv/build
    Start 1: global_3dvar
    Start 2: global_4dvar
    Start 3: global_4denvar
    Start 4: hwrf_nmm_d2
    Start 5: hwrf_nmm_d3
    Start 6: rtma
    Start 7: rrfs_3denvar_glbens
    Start 8: netcdf_fv3_regional
    Start 9: global_enkf
1/9 Test #7: rrfs_3denvar_glbens ..............   Passed  1390.16 sec
2/9 Test #8: netcdf_fv3_regional ..............   Passed  1567.75 sec
3/9 Test #4: hwrf_nmm_d2 ......................   Passed  1571.04 sec
4/9 Test #5: hwrf_nmm_d3 ......................   Passed  1579.05 sec
5/9 Test #9: global_enkf ......................   Passed  1752.45 sec
6/9 Test #6: rtma .............................   Passed  2058.85 sec
7/9 Test #3: global_4denvar ...................   Passed  2275.46 sec
8/9 Test #1: global_3dvar .....................   Passed  2338.09 sec
9/9 Test #2: global_4dvar .....................   Passed  2407.96 sec

100% tests passed, 0 tests failed out of 9

Total Test time (real) = 2407.97 sec

@TingLei-NOAA
Copy link
Contributor

@GangZhao-NOAA Thanks a lot for your efforts improving the codes and has the productive discussions with @guoqing-noaa sorting out those questions, especially the last tricky one. I will approve it now.

@GangZhao-NOAA
Copy link
Contributor Author

@TingLei-NOAA
Thank you so much, Ting!
-Gang

@GangZhao-NOAA
Copy link
Contributor Author

@guoqing-noaa @TingLei-NOAA @MatthewMorris-NOAA @hu5970
I just merged latest updates (3 new commits released yesterday) of GSI from develop branch to my code, these are straightforward merge. Please give a new review to this PR #614. Since the merged code has no influence to my code, so the review should be very simple and straightforward.
Sorry for bothering you again!
Thank you!
-Gang

src/gsi/rapidrefresh_cldsurf_mod.f90 Outdated Show resolved Hide resolved
iret = nf90_inq_varid(gfile_loc,'HOWV',id_howv) ! double check with name in uppercase
end if
if ( iret /= nf90_noerr ) then
i_howv_3dda = 0 ! howv does not exist in firstguess, then stop GSI run.
Copy link
Contributor

Choose a reason for hiding this comment

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

Line 1919 is not needed as GSI dies immediately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@guoqing-noaa
I agree, since GSI is going to abort immediately in this case.
My thought about keeping this line (i_howv_3dda = 0) here, is to mark this event (howv is NOT in firstguess) and can be used later, if in the future some users, eg. NCO, would not like to stop the running of GSI just just due to missing of howv, setting i_howv_3dda = 0 will be useful. And keeping this line here does no harm to the efficiency and accuracy of code.
Thank you!

src/gsi/gsi_rfv3io_mod.f90 Outdated Show resolved Hide resolved
@guoqing-noaa
Copy link
Contributor

Hi @guoqing-noaa, @TingLei-NOAA @hu5970, @MatthewMorris-NOAA, @ManuelPondeca-NOAA @GangZhao-NOAA,
There is one suggestion from Guoqing (@guoqing-noaa) -- "I would suggest making i_howv_in_3dda a tuning parameter in a GSI namelist". Manuel and I discussed on it, and Manuel pointed out that, if howv is added in anavinfo, esp. added as state vector and control vector, howv would be analyzed, even user sets "i_howv_3dda=0" and wants to turn it off. This would be a problem.

Hi @GangZhao-NOAA , thanks a lot for the testing! Yes, you are right. I did not consider that we will also add howv in the control vector section. So, in this situation, we will need to have two different versions of the anavinfo files for howv runs and no-howv runs respectively.

I think this PR should work without any running issues.
However, as for the treatment of i_howv_in_3dda, we have different preferences. I would prefer putting i_howv_in_3dda as a namelist parameter so as to avoid the following source code changes:

src/gsi/gsi_rfv3io_mod.f90
mpi_itype, call mpi_bcast(i_howv_3dda,...

src/gsi/rapidrefresh_cldsurf_mod.f90
Lines 451-459, 362-364 and 367

This is just a personal preference.

@GangZhao-NOAA
Copy link
Contributor Author

GangZhao-NOAA commented Sep 26, 2023 via email

@guoqing-noaa
Copy link
Contributor

This PR has already gotten two approvals. I think it is enough for the review handing team to decide next step. Thanks!

@hu5970
Copy link
Collaborator

hu5970 commented Sep 28, 2023

@GangZhao-NOAA Could you do regression tests on WCOSS2 and Hera for this PR? Thanks, Ming

@GangZhao-NOAA
Copy link
Contributor Author

@hu5970
I ran the regression test with the latest commit (f6031bd) on Hera. I will run the regression test on WCOSS2 asap. Then I will put the results here.
Thank you!
-Gang

@hu5970
Copy link
Collaborator

hu5970 commented Sep 28, 2023

WCOSS2 is not in good shape for running jobs. It took for most of the day to finish a set of regression tests. Here are the regression tests results for this PR on Cactus:

Test project /lfs/h2/emc/ptmp/Ming.Hu/gsi/GSI/build
    Start 1: global_3dvar
    Start 2: global_4dvar
    Start 3: global_4denvar
    Start 4: hwrf_nmm_d2
    Start 5: hwrf_nmm_d3
    Start 6: rtma
    Start 7: rrfs_3denvar_glbens
    Start 8: netcdf_fv3_regional
    Start 9: global_enkf

1/9 Test #8: netcdf_fv3_regional ..............   Passed  608.21 sec
2/9 Test #9: global_enkf ......................   Passed  952.08 sec
3/9 Test #4: hwrf_nmm_d2 ......................   Passed  1437.10 sec
4/9 Test #5: hwrf_nmm_d3 ......................***Failed  1491.34 sec
5/9 Test #7: rrfs_3denvar_glbens ..............***Failed  2127.19 sec
6/9 Test #2: global_4dvar .....................***Failed  2227.32 sec
7/9 Test #1: global_3dvar .....................***Failed  2262.66 sec

The results of failed test cases were checked and there are the reason of failures:
hwrf_nmm_d3: "Failed the scalability test"
rrfs_3denvar_glbens: "Failure of timethresh2","Failed the scalability"
global_4dvar: "Failure of timethresh2", "Failed the scalability"
global_3dvar: "Failed the scalability"

Those are not fatal failure. We can think those 8 cases are passed.

Now, the last case is "global_4denvar" and it crashed several times for both control runs and update runs.
Those crash was random but all related to MPI. After several tries, I finally got:

Test project /lfs/h2/emc/ptmp/Ming.Hu/gsi/GSI/build
    Start 3: global_4denvar
1/1 Test #3: global_4denvar ...................   Passed  845.36 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 846.95 sec

@GangZhao-NOAA
Copy link
Contributor Author

@hu5970
Thank you, Ming for running the regression tests on WCOSS2.

I followed your suggestions and re-compiled the GSI code on hera: first I compiled GSI code with develop branch (commit #ca19008 ) secondly I checked out the branch "feature/3drtma_howv (commit #f6031bd)", and recompiled GSI code. Then I started the regression tests on Hera. Here are the brief results, firstly I ran 9 regression tasks in a batch:

[Gang.Zhao@hfe06:build] (feature/3drtma_howv)$ ctest -j 9
Test project /scratch1/NCEPDEV/da/Gang.Zhao/ProdGSI_dev/develop/build
    Start 1: global_3dvar
    Start 2: global_4dvar
    Start 3: global_4denvar
    Start 4: hwrf_nmm_d2
    Start 5: hwrf_nmm_d3
    Start 6: rtma
    Start 7: rrfs_3denvar_glbens
    Start 8: netcdf_fv3_regional
    Start 9: global_enkf
1/9 Test #9: global_enkf ......................   Passed  5923.05 sec
2/9 Test #7: rrfs_3denvar_glbens ..............***Failed  6432.71 sec
3/9 Test #3: global_4denvar ...................   Passed  6474.41 sec
4/9 Test #8: netcdf_fv3_regional ..............   Passed  6855.91 sec
5/9 Test #4: hwrf_nmm_d2 ......................   Passed  7094.17 sec
6/9 Test #5: hwrf_nmm_d3 ......................   Passed  7105.82 sec
7/9 Test #6: rtma .............................   Passed  7337.08 sec
8/9 Test #2: global_4dvar .....................   Passed  9969.41 sec
9/9 Test #1: global_3dvar .....................   Passed  10013.67 sec

89% tests passed, 1 tests failed out of 9

Total Test time (real) = 10013.68 sec

The following tests FAILED:
          7 - rrfs_3denvar_glbens (Failed)
Errors while running CTest

There is one task, rfs_3denvar_glbens, which failed in the scalability test. Then I re-ran this task:

[Gang.Zhao@hfe06:build] (feature/3drtma_howv)$ ctest -R rrfs_3denvar_glbens
Test project /scratch1/NCEPDEV/da/Gang.Zhao/ProdGSI_dev/develop/build
    Start 7: rrfs_3denvar_glbens
1/1 Test #7: rrfs_3denvar_glbens ..............   Passed  1330.33 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 1330.36 sec

Then the task "rrfs_3denvar_glbens" also succeeded.
So all the 9 tasks of regression tests of GSI were done successfully on HERA.

@ShunLiu-NOAA ShunLiu-NOAA merged commit 728d006 into NOAA-EMC:develop Sep 29, 2023
4 checks passed
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.

Adding I/O for Analysis of Significant Wave Height for 3DRTMA
6 participants