Skip to content
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
46 changes: 0 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,52 +187,6 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
# Add all of the above files to the list of schemes with special compiler flags
list(APPEND SCHEMES_SFX_OPT ./physics/radiation_aerosols.f)

# Force consistent results of math calculations for MG microphysics;
# in Debug/Bitforbit mode; without this flag, the results of the
# intrinsic gamma function are different for the non-CCPP and CCPP
# version (on Theia with Intel 18). Note this is only required for
# the dynamic CCPP build, not for the static CCPP build.
if (TRANSITION)
# Replace -xHost or -xCORE-AVX2 with -xCORE-AVX-I, -no-prec-div with -prec-div, and
# -no-prec-sqrt with -prec-sqrt for certain files for bit-for-bit reproducibility
# with non-CCPP builds. These may go in the future once the CCPP solution is fully accepted.
set(CMAKE_Fortran_FLAGS_LOPT2 ${CMAKE_Fortran_FLAGS_OPT})
string(REPLACE "-no-prec-div" "-prec-div"
CMAKE_Fortran_FLAGS_LOPT2
"${CMAKE_Fortran_FLAGS_LOPT2}")
string(REPLACE "-no-prec-sqrt" "-prec-sqrt"
CMAKE_Fortran_FLAGS_LOPT2
"${CMAKE_Fortran_FLAGS_LOPT2}")
string(REPLACE "-xCORE-AVX2" "-xCORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT2
"${CMAKE_Fortran_FLAGS_LOPT2}")
string(REPLACE "-axSSE4.2,AVX,CORE-AVX2" "-axSSE4.2,AVX,CORE-AVX-I"
CMAKE_Fortran_FLAGS_LOPT2
"${CMAKE_Fortran_FLAGS_LOPT2}")
SET_SOURCE_FILES_PROPERTIES(./physics/micro_mg2_0.F90
./physics/micro_mg3_0.F90
./physics/aer_cloud.F
./physics/cldmacro.F
./physics/gfdl_fv_sat_adj.F90
./physics/module_gfdl_cloud_microphys.F90
./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_OPT ./physics/micro_mg2_0.F90
./physics/micro_mg3_0.F90
./physics/aer_cloud.F
./physics/cldmacro.F
./physics/module_gfdl_cloud_microphys.F90
./physics/sflx.f
./physics/satmedmfvdif.F
./physics/cs_conv.F90
./physics/gcm_shoc.F90
./physics/gfdl_fv_sat_adj.F90)
endif (TRANSITION)

# Remove files with special compiler flags from list of files with standard compiler flags
list(REMOVE_ITEM SCHEMES ${SCHEMES_SFX_OPT})
# Assign standard compiler flags to all remaining schemes and caps
Expand Down
11 changes: 0 additions & 11 deletions physics/gfdl_cloud_microphys.F90
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ subroutine gfdl_cloud_microphys_run( &
real(kind=kind_phys), dimension(:,:), allocatable :: den
real(kind=kind_phys) :: onebg
real(kind=kind_phys) :: tem
#ifdef TRANSITION
real(kind=kind_phys), volatile :: volatile_var1, volatile_var2
#endif

! Initialize CCPP error handling variables
errmsg = ''
Expand Down Expand Up @@ -260,18 +257,10 @@ subroutine gfdl_cloud_microphys_run( &
! calculate fraction of frozen precipitation using unscaled
! values of rain0, ice0, snow0, graupel0 (for bit-for-bit)
do i=1,im
#ifdef TRANSITION
volatile_var1 = rain0(i)+snow0(i)+ice0(i)+graupel0(i)
volatile_var2 = snow0(i)+ice0(i)+graupel0(i)
prcp0(i) = volatile_var1 * tem
if ( volatile_var1 * tem > rainmin ) then
sr(i) = volatile_var2 / volatile_var1
#else
prcp0(i) = (rain0(i)+snow0(i)+ice0(i)+graupel0(i)) * tem
if ( prcp0(i) > rainmin ) then
sr(i) = (snow0(i) + ice0(i) + graupel0(i)) &
/ (rain0(i) + snow0(i) + ice0(i) + graupel0(i))
#endif
else
sr(i) = 0.0
endif
Expand Down
22 changes: 0 additions & 22 deletions physics/gfdl_fv_sat_adj.F90
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je,

! Local variables
real(kind=kind_dyn), dimension(is:ie,js:je) :: dpln
#ifdef TRANSITION
! For bit-for-bit reproducibility
real(kind=kind_dyn), volatile :: volatile_var
#endif
integer :: kdelz
integer :: k, j, i

Expand All @@ -317,9 +313,6 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je,
!$OMP ql,qv,te0,fast_mp_consv, &
!$OMP hydrostatic,ng,zvir,pkz, &
!$OMP akap,te0_2d,ngas,qvi) &
#ifdef TRANSITION
!$OMP private(volatile_var) &
#endif
!$OMP private(k,j,i,kdelz,dpln)
#endif

Expand Down Expand Up @@ -351,28 +344,13 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je,
do j=js,je
do i=is,ie
#ifdef MOIST_CAPPA
#ifdef TRANSITION
volatile_var = log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))
pkz(i,j,k) = exp(cappa(i,j,k)*volatile_var)
#else
pkz(i,j,k) = exp(cappa(i,j,k)*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)))
#endif
#else
#ifdef TRANSITION
#ifdef MULTI_GASES
volatile_var = log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))
pkz(i,j,k) = exp(akap*(virqd(q(i,j,k,1:num_gas))/vicpqd(q(i,j,k,1:num_gas))*volatile_var)
#else
volatile_var = log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))
pkz(i,j,k) = exp(akap*volatile_var)
#endif
#else
#ifdef MULTI_GASES
pkz(i,j,k) = exp(akap*(virqd(q(i,j,k,1:num_gas))/vicpqd(q(i,j,k,1:num_gas))*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)))
#else
pkz(i,j,k) = exp(akap*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)))
#endif
#endif
#endif
enddo
enddo
Expand Down
2 changes: 2 additions & 0 deletions physics/machine.F
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module machine
&, kind_phys = 8 ,kind_taum=8 &
&, kind_grid = 8 &
&, kind_REAL = 8 &! used in cmp_comm
&, kind_LOGICAL = 4 &
&, kind_INTEGER = 4 ! -,,-

#else
Expand All @@ -34,6 +35,7 @@ module machine
&, kind_phys = 4 ,kind_taum=4 &
&, kind_grid = 4 &
&, kind_REAL = 4 &! used in cmp_comm
&, kind_LOGICAL = 4 &
&, kind_INTEGER = 4 ! -,,-

#endif
Expand Down
12 changes: 12 additions & 0 deletions physics/machine.meta
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@
units = none
dimensions = ()
type = integer
[kind_LOGICAL]
standard_name = kind_LOGICAL
long_name = definition of kind_LOGICAL
units = none
dimensions = ()
type = integer
[kind_INTEGER]
standard_name = kind_INTEGER
long_name = definition of kind_INTEGER
units = none
dimensions = ()
type = integer
16 changes: 10 additions & 6 deletions physics/module_BL_MYJPBL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ MODULE MODULE_BL_MYJPBL
! ,G,P608,PI,PQ0,R_D,R_V,RHOWATER &
! ,STBOLT,CAPPA

USE machine, only: kfpt => kind_phys, &
kint => kind_INTEGER, &
klog => kind_LOGICAL

!-----------------------------------------------------------------------
!
IMPLICIT NONE
Expand All @@ -36,12 +40,12 @@ MODULE MODULE_BL_MYJPBL
! real (kind=kdbl),parameter :: r8_in=x'fff7ffffffffffff'
! integer(kind=kint),parameter :: i4_in=-999 ! -huge(1)

integer,parameter:: &
klog=4 & ! logical variables
,kint=4 & ! integer variables
!,kfpt=4 & ! floating point variables
,kfpt=8 & ! floating point variables
,kdbl=8 ! double precision
! integer,parameter:: &
! klog=4 & ! logical variables
! ,kint=4 & ! integer variables
! !,kfpt=4 & ! floating point variables
! ,kfpt=8 & ! floating point variables
! ,kdbl=8 ! double precision

REAL(kind=kfpt),PARAMETER :: A2=17.2693882,A3=273.15,A4=35.86,CP=1004.6 &
,ELIV=2.850e6,ELWV=2.501e6,R_V=461.6 &
Expand Down
20 changes: 10 additions & 10 deletions physics/module_MYJPBL_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

MODULE myjpbl_wrapper

USE machine, only: kfpt => kind_phys, &
kind_phys

contains

subroutine myjpbl_wrapper_init ()
Expand All @@ -13,11 +16,9 @@ end subroutine myjpbl_wrapper_finalize

!!
!> \brief This scheme (1) performs pre-myjpbl work, (2) runs the myjpbl, and (3) performs post-myjpbl work
#if 0
!! \section arg_table_myjpbl_wrapper_run Argument Table
!! \htmlinclude myjpbl_wrapper_run.html
!!
#endif
!###===================================================================
SUBROUTINE myjpbl_wrapper_run( &
& restart,do_myjsfc, &
Expand All @@ -42,19 +43,18 @@ SUBROUTINE myjpbl_wrapper_run( &
& me, lprnt, errmsg, errflg )

!
use machine, only : kind_phys

use MODULE_BL_MYJPBL, only: MYJPBL_INIT,MYJPBL

!-------------------------------------------------------------------
implicit none

integer,parameter:: &
klog=4 & ! logical variables
,kint=4 & ! integer variables
!,kfpt=4 & ! floating point variables
,kfpt=8 & ! floating point variables
,kdbl=8 ! double precision
! integer,parameter:: &
! klog=4 & ! logical variables
! ,kint=4 & ! integer variables
! !,kfpt=4 & ! floating point variables
! ,kfpt=8 & ! floating point variables
! ,kdbl=8 ! double precision

!-------------------------------------------------------------------
! --- constant parameters:
Expand Down Expand Up @@ -121,7 +121,7 @@ SUBROUTINE myjpbl_wrapper_run( &
integer :: i_min, i_max, k_min, k_max

logical :: lprnt1,lprnt2
integer (kind=kint) :: ict, ide, lm, me1
integer :: ict, ide, lm, me1
real(kind=kfpt) :: dt_myj, tem, tem1, tem2, ptem
integer,dimension(im) :: kpbl_myj
real(kind=kfpt),dimension(1:levs-1):: epsl
Expand Down
17 changes: 10 additions & 7 deletions physics/module_MYJSFC_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

MODULE myjsfc_wrapper

USE machine, only: kfpt => kind_phys, &
kind_phys

contains

subroutine myjsfc_wrapper_init ()
Expand Down Expand Up @@ -47,19 +50,19 @@ SUBROUTINE myjsfc_wrapper_run( &
& wind, con_cp, con_g, con_rd, &
& me, lprnt, errmsg, errflg ) ! intent(inout)
!
use machine, only : kind_phys

use MODULE_SF_JSFC, only: JSFC_INIT,JSFC

!-------------------------------------------------------------------
implicit none
!-------------------------------------------------------------------

integer,parameter:: &
klog=4 & ! logical variables
,kint=4 & ! integer variables
!,kfpt=4 & ! floating point variables
,kfpt=8 & ! floating point variables
,kdbl=8 ! double precision
! integer,parameter:: &
! klog=4 & ! logical variables
! ,kint=4 & ! integer variables
! !,kfpt=4 & ! floating point variables
! ,kfpt=8 & ! floating point variables
! ,kdbl=8 ! double precision
!
! --- constant parameters:
! real(kind=kind_phys), parameter :: karman = 0.4
Expand Down
15 changes: 9 additions & 6 deletions physics/module_SF_JSFC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ MODULE MODULE_SF_JSFC
!
!-----------------------------------------------------------------------
!

USE machine, only: kfpt => kind_phys

IMPLICIT NONE
!
!-----------------------------------------------------------------------
Expand All @@ -35,12 +38,12 @@ MODULE MODULE_SF_JSFC
! real (kind=kdbl),parameter :: r8_in=x'fff7ffffffffffff'
! integer(kind=kint),parameter :: i4_in=-999 ! -huge(1)
!
integer,parameter:: &
klog=4 & ! logical variables
,kint=4 & ! integer variables
!,kfpt=4 & ! floating point variables
,kfpt=8 & ! floating point variables
,kdbl=8 ! double precision
! integer,parameter:: &
! klog=4 & ! logical variables
! ,kint=4 & ! integer variables
! !,kfpt=4 & ! floating point variables
! ,kfpt=8 & ! floating point variables
! ,kdbl=8 ! double precision
!
PRIVATE
!
Expand Down