-
Notifications
You must be signed in to change notification settings - Fork 317
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
Fix double-precision builds of MPAS-A v8.2.0 #1208
Fix double-precision builds of MPAS-A v8.2.0 #1208
Conversation
…) arrays This commit adds a new routine to the dmpar module for broadcasing real(kind=R4KIND) arrays. The new mpas_dmpar_bcast_real4s routine mirrors the mpas_dmpar_bcast_reals routine, with the dummy array argument being of R4KIND rather than RKIND kind.
This bugfix PR depends on PR #1207 to add the necessary broadcast routine for |
…sics.F The mpas_atmphys_init_microphysics module contains a routine, table_ccnAct, that broadcasts an R4KIND real array, tnccn_act, from the Thompson microphysics scheme. This broadcast was previously performed by a call to mpas_dmpar_bcast_reals through the macro DM_BCAST_MACRO. However, because the mpas_dmpar_bcast_reals routine broadcasts arrays of kind RKIND, when MPAS-A is compiled with double-precision reals, the mpas_dmpar_bcast_reals routine can no longer be used with the tnccn_act array. With this commit, the DM_BCAST_MACRO in mpas_atmphys_init_microphysics.F has been defined to mpas_dmpar_bcast_real4s, which broadcasts arrays of R4KIND reals. This works for both single- and double-precision builds of MPAS-A, since the kind type of the tnccn_act array is independent of the MPAS-A build precision.
efd9bff
to
6b705bc
Compare
This is quite interesting. I had actually done this in the past (adding a mpas_dmpar_bcast_real4s) for exactly that reason but never made a PR since we now mostly use single precision. Totally forgot to test compiling MPAS using double precision. I, of course, approve this PR. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! I was able to compile MPAS-Model with double precision enabled on both gnu and intel platforms with GNU Make and CMake.
This merge addresses several issues in the MPAS-Atmosphere model and in the MPAS infrastructure. Specific changes in this merge include: * Improved detection of an 'mpi_f08' module (PR #1202), as well as improved detection of netCDF and PnetCDF library paths (PR #1203), in the top-level Makefile. * The addition of a missing dependency in the physics Makefile to correct parallel build issues (PR #1204). * Fixes to the CMake build files used by MPAS-JEDI (PR #1205). * Fixes to double-precision builds of MPAS-Atmosphere (PR #1207, PR #1208). * Correction of the calculation of height AGL used in the computation of 1-km radar reflectivity fields (PR #1213). * Correction of an issue that prevented the MYNN PBL scheme from being used without also using the Thompson aerosol-aware microphysics (PR #1215). * Fixes to allow MPAS-Atmosphere to be built without physics (i.e., dynamics- only builds) (PR #1221). * Various code cleanup and minor corrections (PR #1206, PR #1212, PR #1224, PR #1226).
This PR corrects double-precision build failures of
mpas_atmphys_init_microphysics.F
in MPAS-A v8.2.0.The
mpas_atmphys_init_microphysics
module contains a routine,table_ccnAct
, thatbroadcasts an
R4KIND
real array,tnccn_act
, from the Thompson microphysicsscheme. This broadcast was previously performed by a call to
mpas_dmpar_bcast_reals
through the macroDM_BCAST_MACRO
. However,because the
mpas_dmpar_bcast_reals
routine broadcasts arrays of kindRKIND
, whenMPAS-A is compiled with double-precision reals, the
mpas_dmpar_bcast_reals
routine can no longer be used with the
tnccn_act
array.With this PR, the
DM_BCAST_MACRO
inmpas_atmphys_init_microphysics.F
hasbeen defined to
mpas_dmpar_bcast_real4s
, which broadcasts arrays ofR4KIND
reals. This works for both single- and double-precision builds of MPAS-A, since
the kind type of the
tnccn_act
array is independent of the MPAS-A buildprecision.