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

Single precision suite-4 from NEPTUNE -- branch jm-nrl-32bitfp-24cc09e -> main #772

Closed
wants to merge 7 commits into from

Conversation

michalakes
Copy link
Contributor

Changes that allows CCPP physics to be compiled and run in the
NRL NEPTUNE model. These changes are relative to CCPP repository
hash 24cc09e (Thu May 27 13:02:47 2021 -0600).

Note that some of the changes here are NRL-specific and may not
relate to the changes for 32-bit floating point. Rather than
take these out, I erred on the side of caution and left them in
to avoid introducing errors.

A few highlights:

  - Autopromotion using -r8 is turned off except for
        mersenne_twister when SINGLE_PREC is defined

      - A number of source files that contained bare subroutines
        and functions are turned to modules and use-associated where
        needed. This is valuable for checking dummy/actual argument
        lists for precision type-agreement

      - Conditional guard-rails added where needed to prevent div-zero
        and neg args to log, sqrt, etc.

Status is that this compiles and runs in NEPTUNE for 150 steps
(75 minutes) without floating point exceptions or NaNs using CCPP
physics suite four.  More careful meteorological V&V is a TODO.
On Narwhal, an AMD Epyc Rome system at NAVO, these changes halved
the time spent in physics.

    J. Michalakes, 20211107

Changes to be committed:
modified: CMakeLists.txt
modified: physics/GFS_MP_generic.F90
modified: physics/GFS_rad_time_vary.fv3.F90
modified: physics/GFS_rad_time_vary.fv3.meta
modified: physics/GFS_rrtmg_post.meta
modified: physics/GFS_rrtmg_pre.F90
modified: physics/GFS_rrtmg_pre.meta
modified: physics/GFS_rrtmg_setup.F90
modified: physics/GFS_rrtmg_setup.meta
modified: physics/calpreciptype.f90
modified: physics/cires_orowam2017.f
modified: physics/cires_ugwp.F90
modified: physics/cires_ugwp_triggers.F90
modified: physics/cires_ugwpv1_sporo.F90
modified: physics/funcphys.f90
modified: physics/gcycle.F90
modified: physics/h2ophys.f
modified: physics/iounitdef.f
modified: physics/machine.F
modified: physics/mfpbl.f
modified: physics/mfpblt.f
modified: physics/mfpbltq.f
modified: physics/mfscu.f
modified: physics/mfscuq.f
modified: physics/module_SGSCloud_RadPre.F90
modified: physics/module_bl_mynn.F90
modified: physics/module_mp_thompson.F90
modified: physics/moninedmf.f
modified: physics/physcons.F90
modified: physics/radiation_astronomy.f
modified: physics/radlw_main.F90
modified: physics/radsw_main.F90
modified: physics/samfdeepcnv.f
modified: physics/sascnvn.F
modified: physics/sfc_diag_post.F90
modified: physics/sfc_drv.f
modified: physics/sfc_drv_ruc.meta
modified: physics/sflx.f
modified: physics/surface_perturbation.F90
modified: physics/tridi.f
modified: physics/ugwp_driver_v0.F

	Changes that allows CCPP physics to be compiled and run in the
	NRL NEPTUNE model. These changes are relative to CCPP repository
	hash 24cc09e (Thu May 27 13:02:47 2021 -0600).

	Note that some of the changes here are NRL-specific and may not
	relate to the changes for 32-bit floating point. Rather than
	take these out, I erred on the side of caution and left them in
	to avoid introducing errors.

	A few highlights:

	  - Autopromotion using -r8 is turned off except for
            mersenne_twister when SINGLE_PREC is defined

          - A number of source files that contained bare subroutines
            and functions are turned to modules and use-associated where
            needed. This is valuable for checking dummy/actual argument
            lists for precision type-agreement

          - Conditional guard-rails added where needed to prevent div-zero
            and neg args to log, sqrt, etc.

	Status is that this compiles and runs in NEPTUNE for 150 steps
	(75 minutes) without floating point exceptions or NaNs using CCPP
	physics suite four.  More careful meteorological V&V is a TODO.
	On Narwhal, an AMD Epyc Rome system at NAVO, these changes halved
	the time spent in physics.

        J. Michalakes, 20211107

 Changes to be committed:
	modified:   CMakeLists.txt
	modified:   physics/GFS_MP_generic.F90
	modified:   physics/GFS_rad_time_vary.fv3.F90
	modified:   physics/GFS_rad_time_vary.fv3.meta
	modified:   physics/GFS_rrtmg_post.meta
	modified:   physics/GFS_rrtmg_pre.F90
	modified:   physics/GFS_rrtmg_pre.meta
	modified:   physics/GFS_rrtmg_setup.F90
	modified:   physics/GFS_rrtmg_setup.meta
	modified:   physics/calpreciptype.f90
	modified:   physics/cires_orowam2017.f
	modified:   physics/cires_ugwp.F90
	modified:   physics/cires_ugwp_triggers.F90
	modified:   physics/cires_ugwpv1_sporo.F90
	modified:   physics/funcphys.f90
	modified:   physics/gcycle.F90
	modified:   physics/h2ophys.f
	modified:   physics/iounitdef.f
	modified:   physics/machine.F
	modified:   physics/mfpbl.f
	modified:   physics/mfpblt.f
	modified:   physics/mfpbltq.f
	modified:   physics/mfscu.f
	modified:   physics/mfscuq.f
	modified:   physics/module_SGSCloud_RadPre.F90
	modified:   physics/module_bl_mynn.F90
	modified:   physics/module_mp_thompson.F90
	modified:   physics/moninedmf.f
	modified:   physics/physcons.F90
	modified:   physics/radiation_astronomy.f
	modified:   physics/radlw_main.F90
	modified:   physics/radsw_main.F90
	modified:   physics/samfdeepcnv.f
	modified:   physics/sascnvn.F
	modified:   physics/sfc_diag_post.F90
	modified:   physics/sfc_drv.f
	modified:   physics/sfc_drv_ruc.meta
	modified:   physics/sflx.f
	modified:   physics/surface_perturbation.F90
	modified:   physics/tridi.f
	modified:   physics/ugwp_driver_v0.F
Fix for used-before-set warning generated by Cray compiler.  TODO: what should smc be besides zero?
Revert previous commit.  SMC is being set, in spite of used-before-set warning from compiler. Cray compiler doesn't see the effects of "contained" subroutines.
Cray compiler reports min_rand is used before being defined.  Looks like it's correct this time.  Only an issue if rand_pertub_on .ne. 0.
@michalakes
Copy link
Contributor Author

I have been porting this version to the Cray compiler, which has found a number if instances where variables or arrays are being used before being defined. I have flagged these with TODO comments. There is also one reported for cu_gf_deep.F90 that I haven't added to the PR yet because I'm checking with Georg Grell.

Fix for array "he" being used before defined. Change its intent from OUT to INOUT
Fix for Cray Fortran unit numbers.  Change NICO2CN from 102 to 113 (must not be between 100 and 102 inclusive)
@grantfirl
Copy link
Collaborator

#797 and #798 contain changes from this PR on top of the latest main. This one can likely be closed.

@areinecke
Copy link

Are there any plans to proceed with this PR?

@grantfirl
Copy link
Collaborator

Are there any plans to proceed with this PR?

@areinecke I'm going to close this particular PR. The work contained within was split into 2 different parts: one that contained the 32-bit changes (which were merged in #918) and one for everything else (#798 ). Some of the changes in #798 have also already been merged, so I'm just about to close that one and submit a "fresh" one with the remaining un-merged changes.

@grantfirl
Copy link
Collaborator

The changes in this PR were separated into separate PRs for purposes of merging (#918 and #952)

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.

4 participants