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: Correct code in module_bl_mynn.F . #1739

Closed
wants to merge 92 commits into from
Closed

Conversation

Nuanyang00
Copy link

Correct code in module_bl_mynn.F .

TYPE: bug fix

KEYWORDS: MYNN, EDMF

SOURCE: Yahua Wang, NUDT-China

DESCRIPTION OF CHANGES:
Problem:
(1) In DMP_mp subroutine module of module_bl_mynn.F, calculation of fltv,fltv = flt + svp1*flq,is wrong.
(2) In mynn_tendencies subroutine module of module_bl_mynn.F, calculation of Dqc,
Dqc(k)=(sqc2(k)/(1.-sqv2(k)) - qc(k))/delt,is wrong.

Solution:
(1) The buoyancy flux is fltv = flt + svp1flqts .
(2) The cloud water tendence is Dqc(k)=(sqc2(k)/(1.-sqc2(k)) - qc(k))/delt .

LIST OF MODIFIED FILES:
M phys/module_bl_mynn.F

TESTS CONDUCTED:

  1. Do mods fix problem? How can that be demonstrated, and was that test conducted?
  2. Are the Jenkins tests all passing?

RELEASE NOTE: Code correction in module_bl_mynn.F.

smileMchen and others added 30 commits October 28, 2021 11:33
TYPE: new features

KEYWORDS: aerosol data assimilation, RACM, MADE-VBS aerosols, WRF-Chem

SOURCE: Soyoung Ha (MMM/NCAR)

DESCRIPTION OF CHANGES:
WRFDA is newly expanded for chem_cv_options=108 for surface chemical data assimilation (PM2.5, PM10, CO, SO2, NO2, O3) using the RACM/MADE-VBS chemistry option in WRF-Chem.

LIST OF MODIFIED FILES:
M Registry/registry.var_chem
M var/da/da_chem_sfc/da_ao_stats_chem_sfc.inc
M var/da/da_chem_sfc/da_calculate_grady_chem_sfc.inc
M var/da/da_chem_sfc/da_chem_sfc.f90
M var/da/da_chem_sfc/da_get_innov_vector_chem_sfc.inc
M var/da/da_chem_sfc/da_residual_chem_sfc.inc
M var/da/da_chem_sfc/da_transform_xtoy_chem_sfc.inc
M var/da/da_chem_sfc/da_transform_xtoy_chem_sfc_adj.inc
M var/da/da_define_structures/da_allocate_observations_chem_sfc.inc
M var/da/da_define_structures/da_deallocate_background_errors.inc
M var/da/da_define_structures/da_define_structures.f90
M var/da/da_main/da_update_firstguess.inc
M var/da/da_obs_io/da_final_write_obs_gas_sfc.inc
M var/da/da_obs_io/da_read_obs_chem_sfc.inc
M var/da/da_obs_io/da_read_omb_tmp.inc
M var/da/da_obs_io/da_scan_obs_chem_sfc.inc
M var/da/da_obs_io/da_write_obs_chem_sfc.inc
M var/da/da_setup_structures/da_get_vertical_truncation.inc
M var/da/da_setup_structures/da_setup_background_errors.inc
M var/da/da_setup_structures/da_setup_be_regional.inc
M var/da/da_setup_structures/da_setup_firstguess_wrf.inc
M var/da/da_setup_structures/da_setup_obs_structures.inc
M var/da/da_setup_structures/da_setup_obs_structures_chem_sfc.inc
M var/da/da_statistics/da_analysis_stats.inc
M var/da/da_statistics/da_print_qcstat.inc
M var/da/da_transfer_model/da_transfer_model.f90
M var/da/da_transfer_model/da_transfer_xatoanalysis.inc
M var/da/da_vtox_transforms/da_transform_vchemtox_adj.inc

TESTS CONDUCTED:
1. All tests were passed with no issues.
2. Jenkins testing is OK
3. WRFDA regression tests passed.

RELEASE NOTE: WRFDA is newly expanded for chem_cv_options=108 for surface chemical data assimilation (PM2.5, PM10, CO, SO2, NO2, O3) using the RACM/MADE-VBS chemistry option in WRF-Chem.
Ha, Soyoung, 2021: Implementation of aerosol data assimilation in WRFDA (V4.0.3) for WRF-Chem (V3.9.1) using the MADE/VBS scheme. Geoscientific Model Development. gmd-2021-74.
KEYWORDS: GPM-GMI, Radiance

SOURCE: Dongmei Xu (NUIST/NCAR)

DESCRIPTION OF CHANGES:
Add new capability to assimilate GPM-GMI Level-1 data in HDF5 format, which can be downloaded from https://gpm.nasa.gov/data/

LIST OF MODIFIED FILES:
M  Registry/registry.var
M   var/build/depend.txt
M   var/da/da_radiance/da_allocate_rad_iv.inc
M   var/da/da_radiance/da_deallocate_radiance.inc
M   var/da/da_radiance/da_initialize_rad_iv.inc
M   var/da/da_radiance/da_qc_rad.inc
M   var/da/da_radiance/da_radiance.f90
M   var/da/da_radiance/da_radiance1.f90
M   var/da/da_radiance/da_radiance_init.inc
M   var/da/da_radiance/da_setup_radiance_structures.inc
M  var/da/da_radiance/module_radiance.f90
M   var/da/da_setup_structures/da_setup_obs_structures.inc
M   var/da/da_setup_structures/da_setup_structures.f90
M  var/run/VARBC.in
A  var/da/da_radiance/da_qc_gmi.inc
A  var/da/da_radiance/da_read_obs_hdf5gmi.inc
A var/run/radiance_info/gpm-1-gmi.info

TESTS CONDUCTED: WRFDA regression tests passed.

RELEASE NOTE: A new capability to assimilate GPM-GMI radiance data
Shen, et al.,2021: Assimilation of GPM Microwave Imager Radiance data with the WRF Hybrid 3DEnVar System for the Prediction of Typhoon Chan-hom (2015), Atmospheric Research. 251, 105422.
TYPE: feature removed

KEYWORDS: NMM

SOURCE: internal

DESCRIPTION OF CHANGES:
If we consider the act of adding in new features to the WRF repository as a "constructionist" activity, then this
PR begins the largest deconstructionist effort ever undertake in WRF.

The Philosophy of Deconstructivism places an emphasis on appearance.

Perhaps the bard has a quote appropos to someone working on a commit for a PR, where that PR is at once a massive 
change and yet is intended to have exactly zero impact: 
_It is a tale. Told by an idiot, full of sound and fury, Signifying nothing._

LIST OF MODIFIED FILES:
_Deleted:_
D	Registry/Registry.NMM
D	dyn_nmm/BALANCE_COMS.F
D	dyn_nmm/BALANCE_PARS.F
D	dyn_nmm/BUCKETS.F
D	dyn_nmm/CLTEND.F
D	dyn_nmm/DSTRB.F
D	dyn_nmm/Makefile
D	dyn_nmm/NMM_NEST_UTILS1.F
D	dyn_nmm/RDTEMP.F
D	dyn_nmm/adve_optim.h
D	dyn_nmm/adve_orig.h
D	dyn_nmm/depend.dyn_nmm
D	dyn_nmm/init_modules_nmm.F
D	dyn_nmm/module_ADVECTION.F
D	dyn_nmm/module_BC_NMM.F
D	dyn_nmm/module_BNDRY_COND.F
D	dyn_nmm/module_CLDWTR.F
D	dyn_nmm/module_CTLBLK.F
D	dyn_nmm/module_DIFFUSION_NMM.F
D	dyn_nmm/module_GWD.F
D	dyn_nmm/module_HIFREQ.F
D	dyn_nmm/module_IGWAVE_ADJUST.F
D	dyn_nmm/module_INDX.F
D	dyn_nmm/module_MPP.F
D	dyn_nmm/module_MPPINIT.F
D	dyn_nmm/module_NEST_UTIL.F
D	dyn_nmm/module_NONHY_DYNAM.F
D	dyn_nmm/module_PHYSICS_CALLS.F
D	dyn_nmm/module_PRECIP_ADJUST.F
D	dyn_nmm/module_SMOOTH_TERRAIN.F
D	dyn_nmm/module_STATS_FOR_MOVE.F
D	dyn_nmm/module_TERRAIN.F
D	dyn_nmm/module_TIMERS.F
D	dyn_nmm/module_ZEROX.F
D	dyn_nmm/module_initialize_real.F
D	dyn_nmm/module_initialize_tropical_cyclone.F
D	dyn_nmm/module_membrane_mslp.F
D	dyn_nmm/module_relax.F
D	dyn_nmm/module_si_io_nmm.F
D	dyn_nmm/module_swath.F
D	dyn_nmm/module_tornado_genesis.F
D	dyn_nmm/module_tracker.F
D	dyn_nmm/nmm_get_cpu.c
D	dyn_nmm/nmm_loop_basemacros.h
D	dyn_nmm/nmm_loop_macros.h
D	dyn_nmm/shift_domain_nmm.F
D	dyn_nmm/solve_nmm.F
D	dyn_nmm/start_domain_nmm.F
D	frame/module_io_quilt_new.F
D	phys/module_mp_HWRF.F
D	phys/module_ra_HWRF.F
D	test/nmm_real/namelist.input
D	test/nmm_real/namelist.input.HWRF
D	test/nmm_real/tomorrow
D	test/nmm_tropical_cyclone/README.NMM.TROPICAL_CYCLONE
D	test/nmm_tropical_cyclone/input.d
D	test/nmm_tropical_cyclone/land.nml
D	test/nmm_tropical_cyclone/namelist.input
D	test/nmm_tropical_cyclone/namelist.wps
D	test/nmm_tropical_cyclone/sigma.d
D	test/nmm_tropical_cyclone/sound.d
D	test/nmm_tropical_cyclone/sound_gfdl.d
D	test/nmm_tropical_cyclone/sound_jordan.d
D	test/nmm_tropical_cyclone/sound_wet.d
D	test/nmm_tropical_cyclone/storm.center

_Modified:_
M	.github/CODEOWNERS
M	Makefile
M	clean
M	compile
M	configure
M	external/RSL_LITE/gen_comms.c
M	external/RSL_LITE/module_dm.F
M	external/RSL_LITE/tfp_tester.F
M	frame/Makefile
M	frame/module_bdywrite.F
M	frame/module_dm_stubs.F
M	frame/module_domain.F
M	frame/module_integrate.F
M	frame/module_io_quilt.F
M	frame/module_nesting.F
M	frame/module_wrf_error.F
M	main/Makefile
M	main/depend.common
M	phys/Makefile
M	phys/module_cumulus_driver.F
M	phys/module_diagnostics_driver.F
M	phys/module_fddagd_driver.F
M	phys/module_microphysics_driver.F
M	phys/module_pbl_driver.F
M	phys/module_radiation_driver.F
M	phys/module_surface_driver.F
M	share/dfi.F
M	share/init_modules.F
M	share/input_wrf.F
M	share/interp_fcn.F
M	share/mediation_feedback_domain.F
M	share/mediation_force_domain.F
M	share/mediation_integrate.F
M	share/mediation_interp_domain.F
M	share/mediation_nest_move.F
M	share/mediation_wrfmain.F
M	share/module_check_a_mundo.F
M	share/module_interp_store.F
M	share/module_model_constants.F
M	share/module_optional_input.F
M	share/module_soil_pre.F
M	share/module_trajectory.F
M	share/output_wrf.F
M	share/set_timekeeping.F
M	share/solve_interface.F
M	share/start_domain.F
M	share/wrf_ext_write_field.F
M	share/wrf_timeseries.F
M	var/build/depend.txt

TESTS CONDUCTED:
1. No "problems" per se. Just removing deadwood code.
2. All Jenkins tests are a PASS.
3. DA code still builds.
4. Restart tests OK.
5. Results for each regression test are identical before vs after.
6. Results for larger tests cases are also bit-for-bit (Wei Wang).
7. Code passes DA regression tests (Jake Liu).

RELEASE NOTE: Starting with release-v4.4, the NMM dynamical core and some NMM-specific source code are being removed from the WRF repository. WRF release-v4.3.x is the latest release with the NMM build options still available.
…t_move and mediation_integrate to remove NMM content

Merge remote-tracking branch 'origin/master' into develop
TYPE: bug fix

KEYWORDS: aerosol optics, Mie calculation, interpolation, extrapolation

SOURCE: Cenlin He and Rajesh Kumar (NCAR)

DESCRIPTION OF CHANGES:
Problem:
When the aerosol refractive indices are outside the lookup table ranges (which are very rare occasions), the 
extrapolation in the parameterized Mie calculation ('mieaer' subroutine) will create unrealistic values for the 
extrapolated aerosol optical parameters. These unphysical fluctuations cause unrealistically high AOD 
values (10^10 and greater) and the model crashes.

Solution:
Force the out-of-range aerosol refractive index to be the min or max boundary values of the lookup table.

LIST OF MODIFIED FILES:
chem/module_optical_averaging.F

TESTS CONDUCTED: 
1. This solution fixes the issue and has been tested in NCAR Cheyenne HPC by Cenlin He (NCAR).
2. Jenkins testing is all PASS.

RELEASE NOTE: Minor bugfix for aerosol optics Mie extrapolation cases in chemistry. When the aerosol refractive indices are outside the lookup table ranges, the extrapolation in the parameterized Mie calculation will create unrealistic values for the extrapolated aerosol optical parameters. These unphysical fluctuations cause unrealistically high AOD values and the model crashes. The solution is to force the out-of-range aerosol refractive index to be the minimum or maximum boundary values of the lookup table.
…nd v (#1583)

TYPE: enhancement

KEYWORDS: accumulated physics tendencies, diagnostics only

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
WRF model can output physics tendencies at any output times, but they are instantaneous values.

Solution:
Add calculation to accumulate physics tendencies in any history output window for theta, qv, u and v fields. In all, 16 
new arrays are added for cumulus, microphysics, shallow cumulus, PBL and radiation. The calculation can be turned 
on by namelist switch acc_phy_tend = 1 in &physics.

LIST OF MODIFIED FILES: 
M       Registry/Registry.EM_COMMON
M       phys/module_diagnostics_driver.F
M       phys/module_diag_misc.F

TESTS CONDUCTED: 
1. Tests are conducted, and accumulated tendency output is checked.
2. Jenkins tests are all passing.

RELEASE NOTE: Sixteen accumulated physics tendencies fields for potential temperature, water vapor mixing ratio, u and v components of the wind are added, and it can be turned on by namelist option acc_phy_tend = 1 in &physics.
TYPE: enhancement

KEYWORDS: 255, return code, true

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
When building the WRF model, one of the early steps is to use the registry program to construct
a large number of include files, and to build the Fortran file module_state_description. This is
constructing a Fortran file, not an executable. The return from that build is non-zero, and that
causes a cascading failure on every AWS build, and (at least) many of the dual OS builds.

Solution:
We cheat. We add the the `true` command after the command that builds the file
module_state_description.F. The return code from the whole process is then, voila, zero.

LIST OF MODIFIED FILES:
modified:   frame/Makefile

TESTS CONDUCTED:
1. Reproducibly, the build fails due to the non-zero return code for the build of the file
module_state_description.F.
```
make[2]: [module_state_description.F] Error 255
```
With the mod, the error code is magically zero, and the WRF code builds without any issues.
2. Jenkins tests are all passing.

RELEASE NOTE: After the inclusion of the unix-y `true` command as the last command in a string of registry-based commands, now the WRF code builds on AWS with the Intel compiler. For other users, this will have no impact.
TYPE: [bug fix]

KEYWORDS: real.exe, MPI, bug fix

SOURCE: Marc Honnorat (EXWEXs)

DESCRIPTION OF CHANGES:
Problem:
The communicator `mpi_comm_allcompute`, created by subroutine `split_communicator` called by `init_modules(1)`, 
is not explicitly activated for the call to `wrf_dm_bcast_bytes( configbuf, nbytes )` in real.exe. On some platforms, 
this may prevent broadcast of namelist configuration (put in `configbuf` after the call to `get_config_as_buffer()`) 
across the MPI processes _before_ the call to `setup_physics_suite()`.

An example of a problematic platform: a cluster of Intel Xeon E5-2650 v4 running on CentOS Linux release 7.6.1810, 
with Intel Parallel Studio XE (various versions, including 2018u3 and 2020u4) and Intel MPI Library (same version).

Solution:
The initialization step used in the WRF executable never triggers a failure as described in issue #1267. This PR reuses 
the temporary MPI context switch from WRF code.

ISSUE: 
Fixes #1267

LIST OF MODIFIED FILES:
M       main/real_em.F

TESTS CONDUCTED: 
1. The modification systematically solves the problem on the noted cluster.
2. Jenkins tests are all passing.

RELEASE NOTE: A fix for an MPI synchronization bug related to (not used) split communicators in the real program provides a solution to issue #1267. For users that have had no troubles with the real program running MPI, this will have no impact.
TYPE: bug fix, enhancement

KEYWORDS: WRFDA, gpsref

SOURCE: Jamie Bresch (NCAR), Wen-Jou Chen and Ying-Jhen Chen (Central Weather Bureau, Taiwan)

DESCRIPTION OF CHANGES:
Moved QC steps in da_get_innov_vector_gpsref.inc to a separate subroutine in a new file da_qc_gpsref.inc.
A few issues in the original code are fixed:
1. keep meaningful inv for observations that failed QC
2. add QC counts for qc_cutoff
3. add write_iv_gpsref switch to replace hard-coded 'goto 12345' statement
4. QC counts (exclude missing_data) are written out in qcstat_gpsref_xx
5. fix sequence number counter in final gts_omb_oma output when gpsref is included
6. fix occasional gpsref RH output `************` in filtered_obs.xxxx that prevents the final filtered_obs_xx from 
being generated.

Results of changes:
1. The restructured code produces the same analysis results (wrfvar_output and statistics) as the original code.
2. The differences are in various diagnostic output files.
3. gpsrf entry is taken out of qcstat_conv_xx and more counts about gpsref QC are written out to 
qcstat_gpsref_xx instead.

The reasons of the change are:
1. gpsref is not conventional ob and should not be part of 'conv' group
2. gpsref is a height-based observation so the statistics are better done in height coordinate
3. the counts grouped in pressure levels in original qcstat_conv_xx for gpsrf appear to be incorrect

A sample qcstat_gpsref_01
```
Quality Control Statistics for GPSRO Refractivity

                      TOTAL    500   1000   1500   2000   3000   5000   6000   7000   8000  10000  12000  15000  18000 >18000 meter
 ntotal           =     882      9     14     19     19     46     93     45     45     45     92     92    137    137     89
 ngood            =     787      4      4      7      7     26     72     42     42     45     92     92    128    137     89
 nrej_height      =       0      0      0      0      0      0      0      0      0      0      0      0      0      0      0
 nrej_allqc       =      95      5     10     12     12     20     21      3      3      0      0      0      9      0      0

 nrej_maxiv       =       9
 nrej_dndz        =      14
 nrej_dndz2       =       5
 nrej_pcnt_below  =      24
 nrej_pcnt_middle =       0
 nrej_pcnt_above  =       0
 nrej_cutoff      =      73
```
New namelist variables have more flexibility for testing the QC impact with the default values matching the original 
code:
```
&OBS_OPT
WRITE_IV_GPSREF        = .false. ! switch to write out RO_Innov_ files
GPSREF_QC_DNDZ_OPT     = 1       ! 0: off, 1: on (default)
GPSREF_QC_DNDZ2_OPT    = 1       ! 0: off, 1: on (default)
GPSREF_QC_DNDZ_THRESH  = -50.0
GPSREF_QC_DNDZ2_THRESH = 100.0
GPSREF_QC_GSI_OPT      = 1       ! 0: off, 1: on (default)
GPSREF_QC_PCNT_OPT     = 1       ! 0: off, 1: on (default)
GPSREF_QC_PCNT_H1      = 7000.0
GPSREF_QC_PCNT_H2      = 25000.0
GPSREF_QC_PCNT_BELOW   = 0.05
GPSREF_QC_PCNT_MIDDLE  = 0.04
GPSREF_QC_PCNT_ABOVE   = 0.10 /
```
LIST OF MODIFIED FILES:
M       Registry/registry.var
M       var/build/depend.txt
M       var/da/da_control/da_control.f90
M       var/da/da_gpsref/da_check_max_iv_gpsref.inc
M       var/da/da_gpsref/da_get_innov_vector_gpsref.inc
A       var/da/da_gpsref/da_get_innov_vector_gpsref_deprecated.inc
M       var/da/da_gpsref/da_gpsref.f90
A       var/da/da_gpsref/da_qc_gpsref.inc
M       var/da/da_minimisation/da_get_innov_vector.inc
M       var/da/da_obs_io/da_read_omb_tmp.inc
M       var/da/da_obs_io/da_write_filtered_obs.inc

TESTS CONDUCTED:
1. the code has been used operationally for a quite while
2. Jenkins tests all passed

RELEASE NOTE: WRFDA gpsref code has been restructured to moved QC steps in da_get_innov_vector_gpsref.inc to a separate subroutine in a new file da_qc_gpsref.inc. New namelist variables are added to have more flexibility for testing gpsref QC impact. Several issues with gpsref diagnostic output have been fixed and qcstat info for gpsref is now in new qcstat_gpsref_xx.
TYPE: enhancement

KEYWORDS: RRTMG, cloud overlap option

SOURCE: Mike Iacono, John Henderson, AER

DESCRIPTION OF CHANGES:

This PR adds a new cloud overlap option for RRTMG, exponential-random (cldovrlp=5). Also added is an optional decorrelation length option - either fixed at 2500 m (idcor=0), or a function of latitude (idcor=1). The decorrelation option works for cloud overlapping option 4 (exponential) too. Tests from one 15 km, east Asian domain in summer, suggests that compared to the default option, maximum-random, this exponential-random produces a slightly cooler atmosphere.

For more information, please see this [report](https://dtcenter.org/sites/default/files/visitor-projects/Iacono_Henderson_DTC_VP_FinalReport_2019-2020.pdf).

LIST OF MODIFIED FILES: 
M       Registry/Registry.EM_COMMON
M       dyn_em/module_first_rk_step_part1.F
M       phys/module_ra_rrtmg_lw.F
M       phys/module_ra_rrtmg_sw.F
M       phys/module_radiation_driver.F
M       run/README.namelist
M       share/output_wrf.F

TESTS CONDUCTED: 
1. Tested in a 15 km east Asian domain. 
2. The Jenkins tests are all passing.

RELEASE NOTE: This PR adds a new cloud overlap option for RRTMG, exponential-random set by namelist cldovrlp=5. A decorrelation length option, idcor, is also added. It is set either fixed at 2500 m (idcor=0), or a function of latitude (idcor=1). The decorrelation option works for cloud overlapping option 4 (exponential) too.
TYPE: bug fix, new feature(s), small impact

KEYWORDS: New iterative procedure, sync towards CCPP version, additional option to use GFS stability functions, 
bug fix for COARE3.5

SOURCE: Joseph Olson (NOAA-GSL)

DESCRIPTION OF CHANGES:
Problem: incorrect coefficient for COARE 3.5 bulk flux algorithm, which caused excess drag over water.
Solution: Updated coefficient from Edson et al (2014, JPO, corrigendum)

Other Changes:
   * Added a "brute-force" iterative method to solve for z/L. This was implemented in the CCPP version of the MYNN 
surface layer scheme. The difference is very small overall between this new method and the previous method. Both 
methods can still occasionally  require > 5 iterations in stable conditions over land, so this change unfortunately did 
not significantly improve that particular behavior. 
   * Added an internal (hard-coded) option "psi_opt" to switch between the default versions (same as in the revised 
SFCLAY scheme) and the stability functions used in the GFS surface layer scheme. The form of these functions are 
compared in Olson et al. (2021, NOAA Tech Memorandum).
   * Removed two unused 3D arrays.
   * Altered some limits for the bulk-Richardson number and surface stability parameter (z/L), which were too 
unrestrictive. This has a very small impact but did reduce some of the extreme instantaneous values of the surface 
fluxes.

LIST OF MODIFIED FILES: 
phys/module_surface_driver.F
phys/module_sf_mynn.F

TESTS CONDUCTED: 
1. Single test cases with addition compiler debug flags enabled.
2. Jenkins test results are all PASS.

RELEASE NOTE: Updates and bug fixes to the MYNN surface layers scheme to bring this scheme closer to the CCPP version of the scheme described in Olson et al (2021):
Olson, Joseph B., Tanya Smirnova, Jaymes S. Kenyon, David D. Turner, John M. Brown, Weizhong Zheng, Benjamin Green (June 2021): A description of the MYNN surface layer scheme. NOAA Technical Memorandum. OAR GSL-67. pp. 33., https://doi.org/10.25923/f6a8-bc75
…osol for mp_physics=28 (#1567)

TYPE: enhancement

KEYWORDS: real, Thompson aerosol-aware, microphysics

SOURCE: Timothy W. Juliano and Pedro A. Jimenez (NCAR/RAL)

DESCRIPTION OF CHANGES:
Problem:
Several modifications have been made to the Thompson Aerosol-Aware scheme (mp_physics=28) in an effort to clean the logic in dyn_em/module_initialize_real and enable more flexibility when pre-processing first guess aerosol fields (e.g., GEOS-5). These modifications are made in preparation for upcoming enhancements to the Thompson AA scheme related to the addition of black carbon aerosol (anthropogenic and biomass burning) and organic carbon biomass burning aerosol, as well as time-varying surface emissions.

Solution:
1. Processing of aerosol in real.exe contained legacy code. Specifically, the monthly qnwfa and qnifa variables (qn?fa_jan, qn?fa_feb, etc.) have been removed from Registry files and dyn_em/module_initialize_real.

2. Modifications have been made to the METGRID.TBL file to simplify the subsequent logic in the real program's dyn_em/module_initialize_real. Specifically, we: 
   * replace FLAG_QNWFA and FLAG_QNIFA with FLAG_QNWFA_CL and FLAG_QNIFA_CL, respectively, in the W_WIF_DEC and I_WIF_DEC entries, where “CL” stands for climatology; 
   * add FLAG_QNWFA and FLAG_QNIFA to the QNWFA and QNIFA entries, respectively, for the first guess aerosol arrays;
   * add entry P_WIF to give the user the option to interpolate the first guess aerosol using the native pressure levels of the host model;
   * use num_wif_levels for any z dimension associated with the aerosol field entries (climatology or first guess);
   * add surface aerosol emission arrays QNWFA2D and QNIFA2D to be processed.

The modifications to METGRID.TBL are as follows: 
```
========================================
name=W_WIF_DEC
z_dim_name=num_wif_levels
interp_option=four_pt+average_4pt
flag_in_output=FLAG_QNWFA_CL
========================================
name=I_WIF_DEC
z_dim_name=num_wif_levels
interp_option=four_pt+average_4pt
flag_in_output=FLAG_QNIFA_CL
========================================
name=QNWFA
z_dim_name=num_wif_levels
interp_option=four_pt+average_4pt
flag_in_output=FLAG_QNWFA
========================================
name=QNIFA
z_dim_name=num_wif_levels
interp_option=four_pt+average_4pt
flag_in_output=FLAG_QNIFA
========================================
name=P_WIF
z_dim_name=num_wif_levels
interp_option=four_pt+average_4pt
flag_in_output=FLAG_P_WIF
========================================
name=QNWFA2D
interp_option=four_pt+average_4pt
flag_in_output=FLAG_QNWFA2D
========================================
name=QNIFA2D
interp_option=four_pt+average_4pt
flag_in_output=FLAG_QNIFA2D
========================================
```

3. At present, if the user sets use_aero_icbc=.true. and does not set num_wif_levels to 30, then the code executes without error, even though the climatological aerosols will not be processed properly. Therefore, we have changed the default value of num_wif_levels from 27 to 30 to prevent unintended errors when the user forgets to set this value in the namelist. We note that with our code modifications, namelist variable num_wif_levels will be used to control both climatology and first guess aerosol processing in dyn_em/module_initialize_real.

4. We have added a new (surrogate) variable, aer_init_opt (integer, default=0), that facilitates much cleaner logic in dyn_em/module_initialize_real while “working in the background” and maintaining backward-compatibility such that namelist options use_aero_icbc and use_rap_aero_icbc may be used in the same manner as before. First, in 
share/module_check_a_mundo, we check if the user has selected Thompson AA and either use_aero_icbc (aer_init_opt=1) or use_rap_aero_icbc (aer_init_opt=2). Here, we also ensure that if aer_init_opt>0, then wif_input_opt=1. Now, in dyn_em/module_initialize_real, we are able to simplify the logic of processing aerosol fields by using select case on aer_init_opt for both the 3D and 2D (surface emissions) aerosol processing.

5. For the 3D aerosol processing, here is the new workflow. When the user selects use_aero_icbc=.true. (i.e., aer_init_opt=1) for climatology aerosol forcing, we interpolate the aerosol fields to the WRF grid pressure levels as before. No changes have been made to the interpolation routine for use_aero_icbc. However, when the user selects use_rap_aero_icbc=.true. (i.e., aer_init_opt=2) for first guess aerosol forcing, we allow for two possibilities: 
   * the user has pre-processed the first guess aerosol such that they are located at the native pressure levels of the host model. In this case, the user will process pressure variable p_wif during metgrid, and flag_p_wif=1, as defined in the modified METGTRID.TBL file, will be written to the met_em files. In dyn_em/module_initialize_real, we check for flag_p_wif=1 and subsequently interpolate the aerosol fields to the WRF grid pressure levels. At this stage, we do not have a way to check to ensure that the user-defined num_wif_levels in the namelist is equal to num_wif_levels written to the met_em files. For now, the best we can do is write a comment to the rsl.out files. 
   * the user has pre-processed the first guess aerosol such that they are interpolated to the ungrib pressure levels. In this case, the user will set num_wif_levels in the namelist equal to num_metgrid_levels; otherwise, a fatal error will occur.

6. For the 2D aerosol processing, here is the new workflow. When the user selects use_aero_icbc=.true. (i.e., aer_init_opt=1) for climatology aerosol forcing, the surface water-friendly and ice-friendly emissions are processed as before. No changes have been made to these routines. However, when the user selects use_rap_aero_icbc=.true. (i.e., aer_init_opt=2) for first guess aerosol forcing, we check for the surface emission flags for water- and ice-friendly and process if they are there; otherwise, the arrays are set to zero.

LIST OF MODIFIED FILES:
M Registry/Registry.EM
M Registry/Registry.EM_CHEM
M Registry/Registry.EM_COMMON
M Registry/Registry.tladj
M Registry/registry.new3d_wif
M dyn_em/module_initialize_real.F
M share/module_check_a_mundo.F
M share/module_optional_input.F

TESTS CONDUCTED:
1. We have tested the logic to ensure that it catches any issues related to namelist options and flags in met_em files. Also, we have tested to make sure that the 3D aerosol fields interpolated to the WRF grid are nearly identical when using either method for aerosol first guess (i.e., interpolating using the native pressure levels of the host model versus the pre-processed aerosol on metgrid levels).
2. Jenkins tests are all PASSING

RELEASE NOTE: Code enhancements are introduced to the processing of aerosol information in real.exe for the Thompson Aerosol-Aware microphysics scheme; specifically, legacy code is removed and logic in the real program is improved.
TYPE: bug fix

KEYWORDS: WRFDA, ensdim_alpha

SOURCE: Jamie Bresch and Craig Schwartz (NCAR), Yi-Chuan Lo (Central Weather Bureau, Taiwan)

DESCRIPTION OF CHANGES:
The PR includes multiple bug fixes that are somewhat intertwined and related to the use of ensembles under not-usually-used scenarios.
The root cause of the various problems (reported by Craig Schwartz and Yi-Chuan Lo) is the inclusion of alpha control variable in the ill-designed `be` data structure.
The list of fixes:
1. fix minimization for precondition_cg=true (default is false) and orthonorm_gradient=true (default is false) when ensdim_alpha>0. The fix also helps with offline varbc (related to unallocated be%cv_mz when use_background_errors=false).
2. fix for 3DEns-FGAT (num_fgat_time>0 and ensdim_alpha>0 and je_factor=1.0). The bug was introduced when trying to fix a bug for 4D-EnVar (commit b449e865).
3. fix offline varbc when use_background_errors=false (commit d69d7bb breaks this capability) by still allocating be%cv_mz when use_background_errors=false to avoid memory segmentation fault. A bonus fix is to skip updating analysis and writing out wrfvar_output for offline varbc (VARBC.out is the only meaningful output) to save computing resources.
4. skip reading be.dat when ensdim_alpha>0 and je_factor=1.0 (i.e. full ensemble mode) to avoid the hassle of providing a climatology be.dat that is not actually used in assimilation.

LIST OF MODIFIED FILES:
M       var/da/da_main/da_solve.inc
M       var/da/da_minimisation/da_calculate_gradj.inc
M       var/da/da_minimisation/da_calculate_j.inc
M       var/da/da_minimisation/da_minimise_cg.inc
M       var/da/da_minimisation/da_transform_vtod_wpec.inc
M       var/da/da_minimisation/da_transform_vtod_wpec_adj.inc
M       var/da/da_minimisation/da_transform_vtoy.inc
M       var/da/da_minimisation/da_transform_vtoy_adj.inc
M       var/da/da_setup_structures/da_setup_be_regional.inc
M       var/da/da_vtox_transforms/da_transform_vpatox.inc
M       var/da/da_vtox_transforms/da_transform_vpatox_adj.inc
M       var/da/da_vtox_transforms/da_transform_vptox.inc
M       var/da/da_vtox_transforms/da_transform_vptox_adj.inc
M       var/da/da_vtox_transforms/da_transform_vtox.inc
M       var/da/da_vtox_transforms/da_transform_vtox_adj.inc
M       var/da/da_vtox_transforms/da_vtox_transforms.f90

TESTS CONDUCTED:
1. the fixed code (implemented in different versions of WRFDA) has been used extensively in different applications
2. WRFDA regression tests (done by @liujake) passed
2. Jenkins tests all passed

RELEASE NOTE: WRFDA has been fixed and enhanced for applications related to offline varbc (use_background_errors=false), 3DEns-FGAT (num_fgat_time>0 and ensdim_alpha>0 and je_factor=1.0), precondition_cg=true and orthonorm_gradient=true when ensdim_alpha>0, full-ensemble mode (ensdim_alpha>0 and je_factor=1.0).
TYPE: enhancement

KEYWORDS: WRFDA, memory, thin_conv

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
thin_conv is true by default. When ob_format=1 (bufr for conventional ob types), thinning_grid_conv(num_ob_indexes) and its sub data arrays are allocated for all ob types as defined in da_control.f90 (obs_names(num_ob_indexes)) even though not all ob types are used.

Solution:
Do not call make3grids (which allocates several data arrays based on the setting of thin_mesh_conv) for ob types that are not used in the assimilation and not coded for thinning.

Note that gpsref horizontal thinning is not implemented for ob_format=1 (but is implemented for ob_format=2), so its thinning grid does not need to be allocated in da_setup_obs_structures_bufr.inc. That is the reason the specific check for gpsref appears in da_setup_obs_structures_bufr.inc but not da_setup_obs_structures_ascii.inc.

Caveat: The same fix logic is done for thin_conv_ascii (default is .false. and only matters when ob_format=2). But I have never tested thin_conv_ascii=.true.

LIST OF MODIFIED FILES:
M       var/da/da_setup_structures/da_setup_obs_structures.inc
M       var/da/da_setup_structures/da_setup_obs_structures_ascii.inc
M       var/da/da_setup_structures/da_setup_obs_structures_bufr.inc
M       var/da/da_setup_structures/da_setup_structures.f90

TESTS CONDUCTED:
1. fixed code has been used extensively by Craig Schwartz.

RELEASE NOTE: WRFDA has been fixed to reduce the memory usage for ob_format=1 (i.e. bufr for conventional obs) and thin_conv=true.
TYPE: bug fix

KEYWORDS: WRFDA, da_rad_diags.exe, gfortran-11

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
On MacOS with GNU Fortran (Homebrew GCC 11.1.0_1) 11.1.0, the stand-alone utility da_rad_diags.exe does not build.
The error messages:
```
gfortran -c -O2 -ftree-vectorize -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz  -fdefault-real-8 -I/usr/local/include da_rad_diags.f
da_rad_diags.f:1804:28:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                            1
Error: Symbol 'nproc' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:36:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                    1
Error: Symbol 'instid' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:49:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                 1
Error: Symbol 'file_prefix' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:61:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                             1
Error: Symbol 'start_date' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:71:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                                       1
Error: Symbol 'end_date' in namelist 'record1' at (1) must be declared before the namelist is declared.
da_rad_diags.f:1804:84:

 1804 |    namelist /record1/ nproc, instid, file_prefix, start_date, end_date, cycle_period
      |                                                                                    1
Error: Symbol 'cycle_period' in namelist 'record1' at (1) must be declared before the namelist is declared.
make[1]: [da_rad_diags.o] Error 1 (ignored)
```

Solution:
Move the namelist statement after variable declarations, then the code builds.

LIST OF MODIFIED FILES:
M       var/da/da_monitor/da_rad_diags.f90

TESTS CONDUCTED:
1. da_rad_diags.exe is generated after the fix.

RELEASE NOTE: N/A (it is probably not worth mentioning)
…1607)

TYPE: enhancement, text only

KEYWORDS: WRFDA, VARBC.in, radiance_info, metop-c

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:

Add metop-c-amsua and metop-c-mhs to VARBC.in and radiance info files to allow the assimilation of metop-c radiances.
The satellite ID for metop-c is already coded in WRFDA, so no changes in the code is needed.
The number of sensors in VARBC.in is increased by 3 instead of 2, because the previous commit to VARBC.in 
(637ecb7) did not advance the counter.

A note: metop-a has been decommissioned in Nov 2021.

LIST OF MODIFIED FILES:
M       var/run/VARBC.in
A       var/run/radiance_info/metop-3-amsua.info
A       var/run/radiance_info/metop-3-mhs.info

TESTS CONDUCTED:
1. tested in offline VARBC runs and got output for metop-c.

RELEASE NOTE: N/A (minor)
TYPE: bug fix

KEYWORDS: KIAPS, radiation, LW

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
In an attempt to get the KIAPS radiation LW scheme to build with older GNU compilers,
some simplifications were introduced to remove ONLY clauses. However, an error was
introduced - a module from RRTMG was "USEd" (hash 911b845 introduced some
simplifications and the error, hash a83c7cb tried to fix the error in the
wrong way).

Solution:
Put the entire KIAPS radiation LW scheme back to the original pristine condition, as the
current GNU compilers have no troubles with building the scheme. And fix that bug!

LIST OF MODIFIED FILES:

TESTS CONDUCTED:
1. GNU builds the original KIAPS LW radiation scheme.
2. Jenkins is all PASS.

RELEASE NOTE: An error was introduced into the KIAPS LW radiation scheme. This problem
tried to fix a compilation failure, and ended up introducing yet another compile-time
failure. The solution is to revert the entire KIAPS LW radiation scheme to the original
pristine condition.
TYPE: enhancement

KEYWORDS: WRFDA, thin_conv

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
1. add a new namelist variable thin_conv_opt(num_ob_indexes) to complement thin_conv/thin_conv_ascii switch.
When thin_conv/thin_conv_ascii is .true., thin_conv_opt can be set differently for each ob type.
thin_conv_opt is further modified inside WRFDA to account for unused ob types (a different implementation to achieve the same memory reduction purpose as previous commit #1604).
2. Some redundant code in several subroutines is moved to a higher-level subroutine.
Now the calculation of some lat/lon info (rlat_min,rlat_max,rlon_min,rlon_max,dlat_grid,dlon_grid) to be used for making thinning grids is done only once in da_setup_obs_structures.inc, rather than in each da_setup_obs_structures_ascii.inc, da_setup_obs_structures_bufr.inc, da_setup_obs_structures_rain.inc, and da_setup_radiance_structures.inc.

LIST OF MODIFIED FILES:
M       Registry/registry.var
M       var/da/da_control/da_control.f90
M       var/da/da_obs_io/da_obs_io.f90
M       var/da/da_obs_io/da_read_obs_ascii.inc
M       var/da/da_obs_io/da_read_obs_bufr.inc
M       var/da/da_obs_io/da_scan_obs_ascii.inc
M       var/da/da_radiance/da_setup_radiance_structures.inc
M       var/da/da_setup_structures/da_setup_obs_structures.inc
M       var/da/da_setup_structures/da_setup_obs_structures_ascii.inc
M       var/da/da_setup_structures/da_setup_obs_structures_bufr.inc
M       var/da/da_setup_structures/da_setup_obs_structures_rain.inc
M       var/da/da_setup_structures/da_setup_structures.f90

TESTS CONDUCTED:
1. tested a few thin_conv and thin_conv_ascii cases and results are the same as V4.3.2.

RELEASE NOTE: N/A for now. Will add description for thin_conv_opt in a future PR.
…s package (#1610)

TYPE: enhancement, bug fix

KEYWORDS: WRF-Solar, diagnostics

SOURCE: Timothy Juliano and Pedro Jimenez (NCAR/RAL)

DESCRIPTION OF CHANGES:
We have added a new 2D variable (`ghi_accum`) and time series variable (`ts_ghi_accum`) for the WRF-Solar 
diagnostics package. This variable uses `SWDNB` as computed by the radiation parameterization to accumulate 
downwelling GHI at the surface. The new variable is set to zero at the beginning of the simulation for either 
`restart=.true.` or `restart=.false.`.

As a separate but very minor change, we have clarified units in the registry for cloud base and cloud height 
WRF-Solar variables.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.solar_fields
M dyn_em/start_em.F
M phys/module_diag_solar.F
M phys/module_diagnostics_driver.F
M phys/module_physics_init.F
M share/wrf_timeseries.F
M run/README.tslist

TESTS CONDUCTED: 
1. Conducted test on Cheyenne to ensure that GHI is summed over time and set to zero properly at initialization for 
both 2D and time series variables.
2. All jenkins test are passing.

RELEASE NOTE: A new variable that accumulates GHI over time is added to the WRF-Solar diagnostics package. Cloud base and cloud height units (AGL) are clarified in the registry.
TYPE: new feature

KEYWORDS: WRFDA, satwnd.bufr

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:

When ob_format=1 (bufr), WRFDA reads NCEP's prepbufr file and processes satellite winds (AMV) contained in prepbufr 
as ob type geoamv. This PR adds the capability to read a separate satwnd bufr file and decode additional AMVs (as 
ob type polaramv) that are not included in prepbufr.

The `use_satwnd_bufr` default is true, when `ob_format=1` and `satwnd.bufr` does not exist in the working directory.
There is no impact except for a warning message of "satwnd.bufr does not exist".

Data sources:
https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gdas.YYYYMMDD/HH/atmos/gdas.tHHz.satwnd.tm00.bufr_d
cheyenne:/gpfs/fs1/collections/rda/data/ds351.0/bufr/YYYY/gdas.satwnd.tHHz.YYYYMMDD.bufr

Thinning for satwnd.bufr (done in da_read_obs_bufr_satwnd.inc) is implemented differently than all other ob types.
Superobbing is available when `thin_conv_opt` (polaramv) is set to 3 (2-D thinning boxes) or 4 (3-D thinning boxes).

The reading of an external obs error table is moved one level up, so the table values can be used by both 
da_read_obs_bufr.inc and da_read_obs_bufr_satwnd.inc

Piggybacking on top of this PR are some other README.namelist update to fix a few typos pointed out by Yi-Chuan Lo 
(Central Weather Bureau, Taiwan) and adding a descrption for recently added gpsref options.

LIST OF MODIFIED FILES:
M       Registry/registry.var
M       var/README.namelist
M       var/build/depend.txt
M       var/da/da_control/da_control.f90
M       var/da/da_obs_io/da_obs_io.f90
M       var/da/da_obs_io/da_read_obs_bufr.inc
A       var/da/da_obs_io/da_read_obs_bufr_satwnd.inc
M       var/da/da_radiance/gsi_thinning.f90
M       var/da/da_setup_structures/da_setup_obs_structures.inc
M       var/da/da_setup_structures/da_setup_obs_structures_bufr.inc
M       var/da/da_setup_structures/da_setup_structures.f90

TESTS CONDUCTED:
1. A few tests were conducted to check that this version of the code runs.
2. Jenkins tests are all passing.

RELEASE NOTE: WRFDA can ingest NCEP's satwnd.bufr (gdas.satwnd.tHHz.YYYYMMDD.bufr) to assimilate more AMVs that are not included in NCEP's prepbufr files. More flexible thinning/superobbing options (thin_conv_opt) and obs error specification (uv_error_opt) are implemented for using satwnd.bufr. See WRFDA/var/README.namelist for details.
TYPE: enhancement

KEYWORDS: urban physics

SOURCE: Do Ngoc Khanh (Tokyo Institute of Technology)

DESCRIPTION OF CHANGES:
Problem: There was a code block repeated 12 times.

Solution: Purely refactor, no change in algorithm.

LIST OF MODIFIED FILES:
M       phys/module_sf_urban.F

TESTS CONDUCTED

1. Confirmed bit-by-bit identical output, before vs after.
2. Jenkins tests are all passing.

RELEASE NOTE: Remove repetitive code in module_sf_urban.F
TYPE: new feature

KEYWORDS: parallel netcdf4

SOURCE: Ted Mansell (NOAA/National Severe Storms Lab)

DESCRIPTION OF CHANGES:
This PR adds an I/O option to use the new netcdf capability in 4.7.4 (and later versions) to write both in parallel 
and with variable compression for the same file. Versions of pnetcdf permitted parallel I/O, but did not permit 
standard HDF5 compression. A new I/O library directory, `external/io_netcdfpar`, has been added that is 
modeled on the similar `external/io_netcdf` directory. Users should see the file doc/README.netcdf4par for 
details on configuring and running.

In a nutshell, steps to use this feature:
1. This capability to use HDF5 compression and to have parallel I/O (similar to pnetcdf) requires NetCDF v4.7.4 
or later.
2. The NetCDF library must be built with MPI.
3. Once the NetCDF library / module is chosen and the NETCDF env variable is correctly pointing to the right 
location, then prior to the `configure` step, the user sets a new environment variable. For example, in csh or 
bash `setenv NETCDFPAR $NETCDF` or `export NETCDFPAR=$NETCDF`, respectively.
4. Set the io_form to 13 to use the parallel compressed netcdf option (usually just for the model output or restarts).
5. This I/O option requires activating the NOCOLONS switch (which is why only model output or restarts are 
recommended, since metgrid files have colons imbedded in the file names).

LIST OF MODIFIED FILES: 
M       Makefile
M       Registry/Registry.EM_COMMON
M       arch/Config.pl
M       arch/md_calls.inc
M       arch/postamble
M       arch/preamble
M       configure
A       doc/README.netcdf4par
M       external/Makefile
A       external/io_netcdfpar/Makefile
A       external/io_netcdfpar/diffwrf.F90
A       external/io_netcdfpar/ext_ncdpar_get_dom_ti.code
A       external/io_netcdfpar/ext_ncdpar_get_var_td.code
A       external/io_netcdfpar/ext_ncdpar_get_var_ti.code
A       external/io_netcdfpar/ext_ncdpar_put_dom_ti.code
A       external/io_netcdfpar/ext_ncdpar_put_var_td.code
A       external/io_netcdfpar/ext_ncdpar_put_var_ti.code
A       external/io_netcdfpar/field_routines.F90
A       external/io_netcdfpar/module_wrfsi_static.F90
A       external/io_netcdfpar/transpose.code
A       external/io_netcdfpar/wrf_io.F90
M       frame/md_calls.m4
M       frame/module_io.F
M       share/mediation_integrate.F
M       share/module_io_domain.F
M       share/output_wrf.F
M       share/wrf_ext_write_field.F

TESTS CONDUCTED: 
1. Tested on lustre file system (cray) with domain sizes up to about 700x700. Will leave the existing chunking as
as the initial implementation.
2. Parallel I/O with compression successfully runs on the NCAR cheyenne system, a GPFS file system. The 
following were set up for modules during the build and within the job script:
```
module purge
module load intel
module load ncarcompilers
module load mpt
module load netcdf-mpi
module load ncarenv
```
3. The tests on cheyenne worked with both GNU/10.1.0 and Intel/19.1.1
4. Jenkins testing is OK.
5. Additional information is now output at the end of the `configure` step regarding I/O options:
```
NetCDF version: 4.8.1
Enabled NetCDF-4/HDF-5: yes
NetCDF built with PnetCDF: no
Enabled NetCDF parallel: yes
Using parallel NetCDF via NETCDFPAR option
```

RELEASE NOTE: Added the ability to write compressed NetCDF4 files in parallel via NetCDF 4.7.4 (and later). The performance is slower than pnetcdf, but can be notably faster than regular NetCDF4 on parallel file systems. As expected, the compression provides files significantly smaller than pnetcdf generates.
Finalize merging of bug fixes from release-v4.3.3 onto master
TYPE: bug fix

KEYWORDS: WRFDA, IO_NETCDFPAR

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
WRFDA does not build after commit e018624.
Registry.EM_COMMON was modified in commit e018624, but WRFDA uses Registry.EM_COMMON.var.

Solution:
Add io_netcdfpar to Registry.EM_COMMON.var

LIST OF MODIFIED FILES:
M       Registry/Registry.EM_COMMON.var

TESTS CONDUCTED:
1. WRFDA builds after the fix
2. Jenkins is all pass (for real).
Bug fix for TAMDAR T variational bias correction

TYPE: bug fix

KEYWORDS: TAMDAR, VarBC

SOURCE: Yi-Chuan Lo (Taiwan Central Weather Bureau), Feng Gao (WeatherFlow Inc.)

DESCRIPTION OF CHANGES:
Problem:
Yi-Chuan Lo at CWB found inconsistency between TAMDAR and Radiance VarBC code.

Solution:
Feng Gao confirmed there is a bug in TAMDAR VarBC code and provided bug fix.

LIST OF MODIFIED FILES: 
M   var/da/da_varbc_tamdar/da_varbc_tamdar_tl.inc
M   var/da/da_varbc_tamdar/da_varbc_tamdar_update.inc

TESTS CONDUCTED: 
1. WRFDA regression tests passed.
2. Jenkins tests are OK

RELEASE NOTE: Bug fix for TAMDAR T VarBC.
…1641)

TYPE: new feature

KEYWORDS: NoahMP

SOURCE: Cenlin He (NCAR)

DESCRIPTION OF CHANGES:
This is step one to synchronize with latest NoahMP Github code version in order to prepare for connecting WRF directly to NoahMP unified Github repo. 

Specifically, the updates in NoahMP since version 4.3:
1. three additional runoff schemes added (OPT_RUN=6, 7, 8)
2. new tile drainage capability/scheme added (OPT_TDRN)
3. New soil time step control capability added to allow users specify a different soil time step from main 
NoahMP time step
4. additional water and energy budget terms added for output and diagnosis
5. updated flood irrigation parameters
6. add constraints for snow thickness during compaction
7. updated snow viscosity coefficient in compaction process
8. add canopy heat storage in canopy temperature calculation
9. updated formulation and parameter values for TOPMODEL groundwater scheme (OPT_RUN=1)
10. Bug fixes: SWE cap value in initialization, NoahMP snow depth update, snow layer index update, floating 
issues in runoff scheme, and BATS albedo scheme

LIST OF MODIFIED FILES: list of changed files (use `git diff --name-status master` to get formatted list)
M       Registry/Registry.EM_COMMON
M       Registry/registry.noahmp
M       dyn_em/module_first_rk_step_part1.F
M       dyn_em/start_em.F
M       phys/module_diag_misc.F
M       phys/module_diagnostics_driver.F
M       phys/module_physics_init.F
M       phys/module_sf_noahmp_glacier.F
M       phys/module_sf_noahmp_groundwater.F
M       phys/module_sf_noahmpdrv.F
M       phys/module_sf_noahmplsm.F
M       phys/module_surface_driver.F
M       run/MPTABLE.TBL
M       run/README.namelist
M       run/SOILPARM.TBL

TESTS CONDUCTED: 
1. successfully compiled and tested for running in NCAR supercomputer by Cenlin He (NCAR)
2. Jenkins tests are all pass.

RELEASE NOTE: Updates from NoahMP and linking WRF directly to NoahMP Github repo.
Bug fix for direct assimilation of radar reflectivity (radar_rf_opt=2)

TYPE: bug fix

KEYWORDS: reflectivity operator, quality control 

SOURCE: Zhiquan (Jake) Liu (NCAR/MMM)

DESCRIPTION OF CHANGES:
Problem:
The namelist parameter "qthres", which is used for hydrometeor base state of TL/AD for no-rain 
background, should not be used in reflectivity forward operator. QC for radar_rf_opt=2 should not 
be confused with that of retrieval radar DA.

Solution:
1. Remove the use of "qthres" in forward operator.
2. Simplify QC to keep obs with both observed and background reflectivity >=rfmin (a namelist parameter).

LIST OF MODIFIED FILES:
M       var/da/da_radar/da_get_innov_vector_radar.inc
M       var/da/da_radar/da_radzicevar.inc
M       var/da/da_radar/da_radzicevar_upper_f.inc
M       var/da/da_radar/da_transform_xtoy_radar.inc
M       var/da/da_radar/da_transform_xtoy_radar_adj.inc
M       var/da/da_setup_structures/da_setup_obs_structures_radar.inc
M       var/da/da_setup_structures/da_setup_structures.f90

TESTS CONDUCTED: 
1. WFRDA Regtest passed.
2. Qualified yes. The parallel netcdf4 mods introduced an error in DA to the develop branch that was not 
caught.

RELEASE NOTE: Bug fixes for direct assimilation of radar reflectivity. The namelist parameter "qthres", which is used for hydrometeor base state of TL/AD for no-rain background, should not be used in reflectivity forward operator. QC for radar_rf_opt=2 should not be confused with that of retrieval radar DA.
TYPE: bug fix

KEYWORDS: Intel, ifort, HWS, BDW, bug

SOURCE: GitHub user jw500

DESCRIPTION OF CHANGES:
Problem: When a user chooses one of the following configuration options for the Intel (HWS/BDW) compiler,
`64. (serial)  65. (smpar)  66. (dmpar)  67. (dm+sm)   INTEL (ifort/icc): HSW/BDW`
they will instead be given a configuration for the corresponding option for basic Intel.
`13. (serial)  14. (smpar)  15. (dmpar)  16. (dm+sm)   INTEL (ifort/icc)`

The configure.wrf file will read
```
#### Architecture specific settings ####

# Settings for    Linux x86_64 ppc64le i486 i586 i686, ifort compiler with icc  (serial)

DESCRIPTION     =       INTEL ($SFC/$SCC)
```

This is the result of "Add missing compiler name for two Intel config stanzas" #1326, hash [commit 0a9c2eb](0a9c2eb)

Solution:
Modified configure.defaults to ensure the "#ARCH" lines were not identical between HSW/BDW Intel and basic Intel options.

LIST OF MODIFIED FILES: 
M    arch/configure.defaults

TESTS CONDUCTED: 
1. Mods fix the issue. A configuration was done to test this.
2. Jenkins tests are all passing.

RELEASE NOTE: Beginning with V4.2.2 a bug was introduced that prevented users from configuring the model with the  "INTEL (ifort/icc): HSW/BDW" option. This is now resolved.
@dudhia
Copy link
Collaborator

dudhia commented May 27, 2022 via email

@joeolson42
Copy link
Contributor

(1) is a bug and it has been fixed in the CCPP version soon to be committed.
However, I don't think (2) is a bug. Jimy or Laura, can you confirm?

@weiwangncar
Copy link
Collaborator

The Jenkins tests have passed:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@dudhia
Copy link
Collaborator

dudhia commented May 27, 2022 via email

@Nuanyang00
Copy link
Author

Nuanyang00 commented May 28, 2022 via email

@Nuanyang00
Copy link
Author

Nuanyang00 commented May 28, 2022 via email

@dudhia
Copy link
Collaborator

dudhia commented Jun 22, 2022

This still needs to be updated to the last release and the PR submitted again. As it is, over 1000 files are changed.

@dudhia
Copy link
Collaborator

dudhia commented Aug 2, 2022

@joeolson42 or @Nuanyang00 can we have fix number 1 as a clean change to the latest release as this PR is on an old version? We are preparing for a bug-fix release 4.4.1 soon.

@dudhia
Copy link
Collaborator

dudhia commented Aug 2, 2022

I notice that the target is V4.1.2. Perhaps we can change that to 4.4.1 to solve this problem.

@weiwangncar
Copy link
Collaborator

@Nuanyang00 This PR is not done correctly. Can you redo this PR following the instructions described in the following page: https://github.com/wrf-model/WRF/wiki/Workflow-for-WRF-Code-Modification. If you encounter any difficulty, let us know soon. Also since the reviewers have only agreed on one of the proposed fixes, please only make that one change. Thanks.

@weiwangncar
Copy link
Collaborator

@Nuanyang00 You will need to first fork the latest WRF repository on Github, then clone it on your own computer. Create a branch, add the code change, and push it up to your fork on Github. Make a PR from the code of your fork. You cannot make changes directly to the main branch of the WRF repository - like you did in this PR.

@dudhia
Copy link
Collaborator

dudhia commented Aug 2, 2022

release-v4.4.1 is the branch to be committed to.

@weiwangncar weiwangncar changed the base branch from release-v4.1.2 to release-v4.3.3 August 3, 2022 21:49
@weiwangncar
Copy link
Collaborator

@dudhia @joeolson42 Can either of you let me know what the correct code change is for item #1?

@joeolson42
Copy link
Contributor

In my latest code, I compute this once (and once only) in the main driver and then pipe it into the subroutine DMP_mf. They are computed as follows:

      ! Surface turbulent fluxes                                   
      flq =flqv+flqc !! LATENT      
      flt =hfx(i)/(rho1(kts)*cpm )-xlvcp*flqc/ex1(kts)  !! Temperature flux                    
      fltv=flt + flqv*p608*th_sfc                       !! Virtual temperature flux

I wouldn't worry about it. I promise to commit an MYNN update very soon. I just tested the updates more in some EUREC4A cases and the clouds look great. Sorry about the delayed update, there just hasn't been as much testing in WRF recently...

@weiwangncar
Copy link
Collaborator

@joeolson42 Thanks, Joe. I will close this PR, since it is not done correctly.

@weiwangncar weiwangncar closed this Aug 3, 2022
@Nuanyang00
Copy link
Author

Sorry for putting forward a wrong view.

After careful inspection of the module_bl_mynn. F program, the calculation formula of sqc in the program is correct.

In module_bl_mynn.F, the specific humidity variables sqc and sqv are defined as :
sqv=qv/(1+qv), sqc=qc/(1+qv),
where qv is mixing ratios of vapor and qc is mixing ratio of cloud water.

And, the mixing ratios can be obtained by inverse calculation:
qv=sqv/(1-sqv), qc=sqc/(1-sqv)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.