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

CCPP acceptance: csawmgshoc* and *_debug bit-for-bit #215

Merged
merged 3 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
./physics/sflx.f
./physics/satmedmfvdif.F
./physics/cs_conv.F90
./physics/gcm_shoc.F90
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS_LOPT2}")
# Add all of the above files to the list of schemes with special compiler flags
list(APPEND SCHEMES_SFX ./physics/micro_mg2_0.F90
Expand All @@ -214,6 +215,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
./physics/sflx.f
./physics/satmedmfvdif.F
./physics/cs_conv.F90
./physics/gcm_shoc.F90
./physics/gfdl_fv_sat_adj.F90)
endif (${CMAKE_BUILD_TYPE} MATCHES "Debug")

Expand Down Expand Up @@ -254,21 +256,22 @@ else (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
endif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")

# The auto-generated caps can contain calls to physics schemes in
# which some of the arguments (pointers) are not associated. This is
# on purpose to avoid allocating fields that are not used inside the
# which some of the arguments (pointers, arrays) are not associated/allocated.
# This is on purpose to avoid allocating fields that are not used inside the
# scheme if, for example, certain conditions are not met. To avoid
# Fortran runtime errors, it is necessary to remove checks for pointers
# that are not associated from the caps ONLY. For the physics schemes,
# these checks can and should remain enabled. Overwriting the check flags
# explicitly works for Intel and GNU, but not for PGI.
# that are not associated and for array bounds from the caps ONLY. For the
# physics schemes, these checks can and should remain enabled. Overwriting
# the pointer check flags explicitly works for Intel and GNU, but not for PGI.
if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
set_property(SOURCE ${CAPS} PROPERTY COMPILE_FLAGS "-fcheck=no-pointer")
set_property(SOURCE ${CAPS} PROPERTY COMPILE_FLAGS "-fcheck=no-pointer,no-bounds")
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
set_property(SOURCE ${CAPS} PROPERTY COMPILE_FLAGS "-check nopointers")
set_property(SOURCE ${CAPS} PROPERTY COMPILE_FLAGS "-check nopointers,nobounds")
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI")
if (CMAKE_Fortran_FLAGS MATCHES ".*chkptr.*")
message (FATAL_ERROR "PGI compiler option chkptr cannot be used for CCPP physics")
endif (CMAKE_Fortran_FLAGS MATCHES ".*chkptr.*")
set_property(SOURCE ${CAPS} PROPERTY COMPILE_FLAGS "-Mnobounds")
endif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")

if (PROJECT STREQUAL "CCPP-FV3")
Expand Down
8 changes: 6 additions & 2 deletions physics/GFS_suite_interstitial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr
real(kind=kind_phys), dimension(im), intent(in) :: xlat
real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0

real(kind=kind_phys), dimension(im, levs), intent(inout) :: rhc, save_qc, save_qi
real(kind=kind_phys), dimension(im, levs), intent(inout) :: rhc, save_qc
! save_qi is not allocated for Zhao-Carr MP
real(kind=kind_phys), dimension(:, :), intent(inout) :: save_qi
real(kind=kind_phys), dimension(im, levs, nn), intent(inout) :: clw

character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -829,7 +831,9 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_t
logical, intent(in) :: ltaerosol, lgocart

real(kind=kind_phys), intent(in) :: con_pi, dtf
real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc, save_qi
real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc
! save_qi is not allocated for Zhao-Carr MP
real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi

real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0
real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw
Expand Down
4 changes: 3 additions & 1 deletion physics/cs_conv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ subroutine cs_conv_pre_run(im, levs, ntrac, ncld, q, clw1, clw2, &
! --- input/output
real(r8), dimension(ntrac-ncld+2), intent(out) :: fswtr, fscav
real(r8), dimension(im), intent(out) :: wcbmax
real(r8), dimension(im,levs), intent(out) :: save_q1,save_q2,save_q3
real(r8), dimension(im,levs), intent(out) :: save_q1,save_q2
! save_q3 is not allocated for Zhao-Carr MP
real(r8), dimension(:,:), intent(out) :: save_q3

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down
2 changes: 1 addition & 1 deletion physics/module_bl_mynn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ MODULE module_bl_mynn
& p_qnc= 0, &
& p_qni= 0

!END FV3 CONSTANTS
!END FV3 CONSTANTS
!====================================================================
!WRF CONSTANTS
! USE module_model_constants, only: &
Expand Down