Skip to content

Update gsd/develop-chem from gsl/develop, bug fixes for uninitialized variables#84

Merged
DomHeinzeller merged 421 commits into
NOAA-GSL:gsd/develop-chemfrom
climbfuji:gsl_develop_chem_add_gocart
Apr 12, 2021
Merged

Update gsd/develop-chem from gsl/develop, bug fixes for uninitialized variables#84
DomHeinzeller merged 421 commits into
NOAA-GSL:gsd/develop-chemfrom
climbfuji:gsl_develop_chem_add_gocart

Conversation

@climbfuji
Copy link
Copy Markdown

@climbfuji climbfuji commented Apr 9, 2021

Description

This PR updates gsd/develop-chem from gsl/develop (all commits except the ones listed in the following) and fixes a few bugs for uninitialized variables/weird logic in gsd/develop-chem that were discovered when adding debug regression tests to the existing chemistry tests (commits 59e8075, 6ac6272, 471a66a).

Following this PR, gsd/develop-chem will be renamed to gsl/develop-chem.

Associated PRs:

NOAA-GSL/GOCART#1
#84
NOAA-GSL/fv3atm#80
NOAA-GSL/ufs-weather-model#70

For regression testing, see NOAA-GSL/ufs-weather-model#70.

climbfuji and others added 30 commits November 24, 2020 08:42
…elop_20201120

Update master from gsd/develop 2020/11/20
…tree/SM_Oct102020, to fix a crash from running GFDL MP with frac_Grid=T as well as restart reproducibility.

Co-authored-with: Shrinivas Moorthi <shrinivas.moorthi@noaa.gov>
Bug fix in GFS_surface_composites.F90 from Moorthi
update with authoritative repo
…e_generic to the gmtb_scm_spec_sfc_flux scheme (fixes specified surface flux cases for SCM)
@climbfuji climbfuji changed the title WORK IN PROGRESS: Update gsd/develop-chem from gsl/develop, add NASA GOCART repository WORK IN PROGRESS: Update gsd/develop-chem from gsl/develop, bug fixes for uninitialized variables Apr 9, 2021
@climbfuji climbfuji changed the title WORK IN PROGRESS: Update gsd/develop-chem from gsl/develop, bug fixes for uninitialized variables Update gsd/develop-chem from gsl/develop, bug fixes for uninitialized variables Apr 9, 2021
@climbfuji climbfuji marked this pull request as ready for review April 9, 2021 20:27
@climbfuji climbfuji requested a review from DomHeinzeller as a code owner April 9, 2021 20:27
Copy link
Copy Markdown
Collaborator

@haiqinli haiqinli left a comment

Choose a reason for hiding this comment

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

I agree with the bug fixes for uninitialized variables.

@SamuelTrahanNOAA
Copy link
Copy Markdown
Collaborator

Why is there both a physics/cires_orowam2017.F90 and physics/cires_orowam2017.f? If they're different files, they should vary by more than just the fortran format extension.

@climbfuji
Copy link
Copy Markdown
Author

Why is there both a physics/cires_orowam2017.F90 and physics/cires_orowam2017.f? If they're different files, they should vary by more than just the fortran format extension.

See NCAR#613 - good catch though!

Copy link
Copy Markdown
Collaborator

@SamuelTrahanNOAA SamuelTrahanNOAA left a comment

Choose a reason for hiding this comment

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

The problems in this PR are all from upstream repositories, unrelated to the intent of this PR. Those problems should not hold up the PR, so I'm giving my approval.

@@ -0,0 +1,354 @@
module cires_orowam2017
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file should be renamed so it differs from cires_orowam2017.f by more than just the fortran format extension (f vs. F90)

! initialization of selected
! init gw-solvers (1,2,3,4)
! initialization of ugwp_common_v0
! init gw-solvers (1,2) .. no UFS-funds for (3,4) tests
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do funding issues belong in source code comments?

! #######################################################################################
#ifdef MPI
if (mpirank .eq. mpiroot) then
#endif
if (doGP_cldoptics_LUT) then
write (*,*) 'Reading RRTMGP shortwave cloud data (LUT) ... '
status = nf90_inq_varid(ncid,'radliq_lwr',varID)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The code should check whether these call succeeded, and at least report that they failed. Otherwise, when a failure occurs, you'll get bad results without knowing why.

! Open file
status = nf90_open(trim(sw_gas_props_file), NF90_NOWRITE, ncid)

! Read dimensions for k-distribution fields
status = nf90_inq_dimid(ncid, 'temperature', dimid)
status = nf90_inquire_dimension(ncid, dimid, len=ntemps)
status = nf90_inquire_dimension(ncid, dimid, len=ntempsSW)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The code should check the return status and report failures, not just ignore them.

!>@brief These subroutines and modules execute the CIRES UGWP Version 0
!>\defgroup ugwpv1_gsldrag_run Unified Gravity Wave Physics General Algorithm
!> @{
!! The physics of NGWs in the UGWP framework (Yudin et al. 2018 \cite yudin_et_al_2018) is represented by four GW-solvers, which is introduced in Lindzen (1981) \cite lindzen_1981, Hines (1997) \cite hines_1997, Alexander and Dunkerton (1999) \cite alexander_and_dunkerton_1999, and Scinocca (2003) \cite scinocca_2003. The major modification of these GW solvers is represented by the addition of the background dissipation of temperature and winds to the saturation criteria for wave breaking. This feature is important in the mesosphere and thermosphere for WAM applications and it considers appropriate scale-dependent dissipation of waves near the model top lid providing the momentum and energy conservation in the vertical column physics (Shaw and Shepherd 2009 \cite shaw_and_shepherd_2009). In the UGWP-v0, the modification of Scinocca (2003) \cite scinocca_2003 scheme for NGWs with non-hydrostatic and rotational effects for GW propagations and background dissipation is represented by the subroutine \ref fv3_ugwp_solv2_v0. In the next release of UGWP, additional GW-solvers will be implemented along with physics-based triggering of waves and stochastic approaches for selection of GW modes characterized by horizontal phase velocities, azimuthal directions and magnitude of the vertical momentum flux (VMF).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Violates Fortran standard's line length limit of 132 characters. This will abort on some compilers (even for comments).

!> @{
!! The physics of NGWs in the UGWP framework (Yudin et al. 2018 \cite yudin_et_al_2018) is represented by four GW-solvers, which is introduced in Lindzen (1981) \cite lindzen_1981, Hines (1997) \cite hines_1997, Alexander and Dunkerton (1999) \cite alexander_and_dunkerton_1999, and Scinocca (2003) \cite scinocca_2003. The major modification of these GW solvers is represented by the addition of the background dissipation of temperature and winds to the saturation criteria for wave breaking. This feature is important in the mesosphere and thermosphere for WAM applications and it considers appropriate scale-dependent dissipation of waves near the model top lid providing the momentum and energy conservation in the vertical column physics (Shaw and Shepherd 2009 \cite shaw_and_shepherd_2009). In the UGWP-v0, the modification of Scinocca (2003) \cite scinocca_2003 scheme for NGWs with non-hydrostatic and rotational effects for GW propagations and background dissipation is represented by the subroutine \ref fv3_ugwp_solv2_v0. In the next release of UGWP, additional GW-solvers will be implemented along with physics-based triggering of waves and stochastic approaches for selection of GW modes characterized by horizontal phase velocities, azimuthal directions and magnitude of the vertical momentum flux (VMF).
!!
!! In UGWP-v0, the specification for the VMF function is adopted from the GEOS-5 global atmosphere model of GMAO NASA/GSFC, as described in Molod et al. (2015) \cite molod_et_al_2015 and employed in the MERRRA-2 reanalysis (Gelaro et al., 2017 \cite gelaro_et_al_2017). The Fortran subroutine \ref slat_geos5_tamp describes the latitudinal shape of VMF-function as displayed in Figure 3 of Molod et al. (2015) \cite molod_et_al_2015. It shows that the enhanced values of VMF in the equatorial region gives opportunity to simulate the QBO-like oscillations in the equatorial zonal winds and lead to more realistic simulations of the equatorial dynamics in GEOS-5 operational and MERRA-2 reanalysis products. For the first vertically extended version of FV3GFS in the stratosphere and mesosphere, this simplified function of VMF allows us to tune the model climate and to evaluate multi-year simulations of FV3GFS with the MERRA-2 and ERA-5 reanalysis products, along with temperature, ozone, and water vapor observations of current satellite missions. After delivery of the UGWP-code, the EMC group developed and tested approach to modulate the zonal mean NGW forcing by 3D-distributions of the total precipitation as a proxy for the excitation of NGWs by convection and the vertically-integrated (surface - tropopause) Turbulent Kinetic Energy (TKE). The verification scores with updated NGW forcing, as reported elsewhere by EMC researchers, display noticeable improvements in the forecast scores produced by FV3GFS configuration extended into the mesosphere.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Violates Fortran standard's line length limit of 132 characters. This will abort on some compilers (even for comments).

@DomHeinzeller
Copy link
Copy Markdown

Thanks @SamuelTrahanNOAA - I will take note of the issues with the upstream code so that it will get fixed.

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.