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

Bug fixes to 3D diagnostic tendencies; add more tendencies #15

Merged

Conversation

SamuelTrahanNOAA
Copy link
Collaborator

@SamuelTrahanNOAA SamuelTrahanNOAA commented Mar 6, 2020

This is the ufs-weather-model pull request for NOAA-GSL/ccpp-physics#18

Bug fixes are added so the 3D diagnostic tendency output works properly. There is a new qdiag3d flag to turn on 3D tracer tendencies. Also, there are now tendencies for the model, ccpp, and total. The later two are for debugging the tendency calculations. The timestep_init and timestep_final stages of CCPP are implemented.

Fully tested with gfs v16 beta test suite.

This is still a draft pull request because:

  1. The GSD v0 and GFS v15p2 tendencies are not yet validated.
  2. The other suites need timestep_init and timestep_final sections added or the build process will fail when they're selected.
  3. There is an unresolved question of how to handle the problem of precision.

The Precision Problem

I can say definitively that double precision floating point is not enough to accumulate tendencies across the orders of magnitude typically found in the atmosphere. This was determined by adding a fourth tendency, now disabled in the code. Every time the ccpp or model tendencies were accumulated, that fourth tendency was accumulated by the same amount. In that case, the tendencies of: temperature had a precision of about 0.1 degrees, water vapor mixing ratio of 1e-5, and wind of .1 meters per second. Those are per-3-hour tendencies from a C768 global model. A higher-resolution run would have much larger imprecision due to the larger number of timesteps.

Those can be viewed as the best possible tendency errors.

Right now, the error in the tendencies of CCPP are about 2.5 times the best possible. It is hard to tell whether it is due to further precision issues (eight times as many additions per timestep) or incorrect tendency logic.

The precision issue could be dealt with using quadruple precision (128 bit) floating-point. That is a part of the Fortran 2008 standard, and it is an optional part of the MPI standard. It may be feasible to implement it, but that could cause portability issues.

@SamuelTrahanNOAA SamuelTrahanNOAA changed the title Feature/gsd phys diag3d Bug fixes to 3D diagnostic tendencies; add more tendencies Mar 6, 2020
@SamuelTrahanNOAA SamuelTrahanNOAA marked this pull request as ready for review March 17, 2020 17:19
@DomHeinzeller
Copy link

@llpcarson @grantfirl - for your information, the latest version of the 3D tendencies PR for NOAA-GSD/fv3atm.

@@ -184,7 +187,10 @@
'FV3/ccpp/physics/physics/gcm_shoc.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/get_prs_fv3.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/gfdl_cloud_microphys.F90' : [ 'slow_physics' ],
'FV3/ccpp/physics/physics/gfdl_fv_sat_adj.F90' : [ 'fast_physics' ],
'FV3/ccpp/physics/physics/gfdl_fv_sat_adj.F90' : [ 'slow_physics' ],

Choose a reason for hiding this comment

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

is this correct? gfdl_fv_sat_adj.F90 should remain in "fast_physics", right?

Choose a reason for hiding this comment

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

Yes, I will revert this.

<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>

Choose a reason for hiding this comment

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

Is this related to the diagnostics output? or an unrelated change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That change is not my doing. It must have been merged from another branch.

@llpcarson
Copy link

All of the SDFs will need the timestep_init and timestep_final (as noted) before merging. This may also break alot of user-workflow-configs, so needs to be merged with plenty of communication!

@SamuelTrahanNOAA
Copy link
Collaborator Author

All of the SDFs will need the timestep_init and timestep_final (as noted) before merging. This may also break alot of user-workflow-configs, so needs to be merged with plenty of communication!

It would be simpler to update the CCPP framework to allow timestep_init and timestep_final to not be declared in the XML file.

@SamuelTrahanNOAA
Copy link
Collaborator Author

I'm trying to test changes to this one by one, but Hera is being very slow, and /scratch2 is freezing up frequently. It may take another day for me to make any meaningful progress on this.

@climbfuji
Copy link

All of the SDFs will need the timestep_init and timestep_final (as noted) before merging. This may also break alot of user-workflow-configs, so needs to be merged with plenty of communication!

It would be simpler to update the CCPP framework to allow timestep_init and timestep_final to not be declared in the XML file.

This is not going to work and not intended. These two additional routines will be required when we move to cap_gen.py anyway, there is no harm adding them now.

hannahcbarnes pushed a commit to hannahcbarnes/fv3atm that referenced this pull request Apr 7, 2020
…L#27)

* add fh00 post control file, add restart output at specified forecast hours, ugwd bug fixes
* fv3atm NOAA-GSL#15:Add support for GEFS-Aerosols restart capability
* remove comment prints
* fix RunDuration in atmos fcst side
* update post_gfs with new post changes
* comment out print line
* point fv3 dycore to the latest NOAA-EMC dev/emc branch
@DomHeinzeller
Copy link

@llpcarson @grantfirl I would like to ask you for your opinion on the standard names for the new variables

    logical              :: flag_for_gwd_generic_tend!< true if GFS_GWD_generic should calculate tendencies
    logical              :: flag_for_pbl_generic_tend!< true if GFS_PBL_generic should calculate tendencies
    logical              :: flag_for_scnv_generic_tend!< true if GFS_DCNV_generic should calculate tendencies
    logical              :: flag_for_dcnv_generic_tend!< true if GFS_DCNV_generic should calculate tendencies

in GFS_typdefs.{F90,meta}. I think that all our flags have standard names starting with flag_for or something similar. I can make those changes in the PRs that I need to create anyway. Thank you!

1 similar comment
@DomHeinzeller
Copy link

@llpcarson @grantfirl I would like to ask you for your opinion on the standard names for the new variables

    logical              :: flag_for_gwd_generic_tend!< true if GFS_GWD_generic should calculate tendencies
    logical              :: flag_for_pbl_generic_tend!< true if GFS_PBL_generic should calculate tendencies
    logical              :: flag_for_scnv_generic_tend!< true if GFS_DCNV_generic should calculate tendencies
    logical              :: flag_for_dcnv_generic_tend!< true if GFS_DCNV_generic should calculate tendencies

in GFS_typdefs.{F90,meta}. I think that all our flags have standard names starting with flag_for or something similar. I can make those changes in the PRs that I need to create anyway. Thank you!

@grantfirl
Copy link

grantfirl commented Apr 16, 2020 via email

@climbfuji
Copy link

How about: flag_for_generic_gravity_wave_drag_tendency flag_for_generic_planetary_boundary_layer_tendency flag_for_generic_shallow_convection_tendency flag_for_generic_deep_convection_tendency

This sounds good to me, thanks very much. Unless I hear any objections from @llpcarson or @SamuelTrahanNOAA, I will make this change.

@llpcarson
Copy link

llpcarson commented Apr 16, 2020 via email

@SamuelTrahanNOAA
Copy link
Collaborator Author

Don't go to far with those long variable names or you'll hit line length or name length limits.

@grantfirl
Copy link

grantfirl commented Apr 16, 2020 via email

@SamuelTrahanNOAA
Copy link
Collaborator Author

Just to be clear, I was not commenting on actual variable names, only their CCPP standard names.

I'm unaware of any string length limits in Python, so you should be able to use the collected works of Shakespeare as the standard name.

Just make sure you have reasonable Fortran variable name lengths.

@DomHeinzeller DomHeinzeller added the do not merge Something is wrong, do not merge label Apr 20, 2020
DomHeinzeller added a commit that referenced this pull request Apr 22, 2020
Bug fixes to 3D diagnostic tendencies (based on #15)
@DomHeinzeller DomHeinzeller merged commit fcc27ec into NOAA-GSL:gsd/develop Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Something is wrong, do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants