diff --git a/dyn_em/module_big_step_utilities_em.F b/dyn_em/module_big_step_utilities_em.F index 72e827b275..96d0c3c26a 100644 --- a/dyn_em/module_big_step_utilities_em.F +++ b/dyn_em/module_big_step_utilities_em.F @@ -2,7 +2,7 @@ !wrf:MODEL_LAYER:DYNAMICS ! -#if (RWORDSIZE == 4) +#ifndef DOUBLE_PRECISION # define VPOWX vspowx # define VPOW vspow #else diff --git a/frame/module_clear_halos.F b/frame/module_clear_halos.F index 88de325ecf..db19e0e5fc 100644 --- a/frame/module_clear_halos.F +++ b/frame/module_clear_halos.F @@ -42,7 +42,7 @@ subroutine clear_ij_halos(grid,how,full_domain) ips, ipe, jps, jpe, kps, kpe logical :: fulldom real :: badR, badR_N,badR_NE,badR_NW,badR_S,badR_SW,badR_SE,badR_E,badR_W -#if (RWORDSIZE==4) +#ifndef DOUBLE_PRECISION double precision :: badD, badD_N,badD_NE,badD_NW,badD_S,badD_SW,badD_SE,badD_E,badD_W #else real :: badD, badD_N,badD_NE,badD_NW,badD_S,badD_SW,badD_SE,badD_E,badD_W diff --git a/phys/ccpp_kind_types.F b/phys/ccpp_kind_types.F index 9360bbf67e..5647ce0362 100644 --- a/phys/ccpp_kind_types.F +++ b/phys/ccpp_kind_types.F @@ -1,5 +1,5 @@ module ccpp_kind_types -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION integer, parameter :: kind_phys = selected_real_kind(6) #else integer, parameter :: kind_phys = selected_real_kind(12) diff --git a/phys/module_mp_wdm5.F b/phys/module_mp_wdm5.F index 6e69b082e2..0e67a665c6 100644 --- a/phys/module_mp_wdm5.F +++ b/phys/module_mp_wdm5.F @@ -1,4 +1,4 @@ -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wdm6.F b/phys/module_mp_wdm6.F index 4509fff847..e30ec5ade9 100644 --- a/phys/module_mp_wdm6.F +++ b/phys/module_mp_wdm6.F @@ -1,4 +1,4 @@ -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wdm7.F b/phys/module_mp_wdm7.F index d29374481c..9096c997e5 100644 --- a/phys/module_mp_wdm7.F +++ b/phys/module_mp_wdm7.F @@ -1,4 +1,4 @@ -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wsm3.F b/phys/module_mp_wsm3.F index a71d3cbfa6..0081a4817e 100644 --- a/phys/module_mp_wsm3.F +++ b/phys/module_mp_wsm3.F @@ -1,7 +1,7 @@ #ifdef _ACCEL # include "module_mp_wsm3_accel.F" #else -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wsm3_accel.F b/phys/module_mp_wsm3_accel.F index bacec9bfad..21c7a7e00e 100644 --- a/phys/module_mp_wsm3_accel.F +++ b/phys/module_mp_wsm3_accel.F @@ -1,4 +1,4 @@ -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wsm5.F b/phys/module_mp_wsm5.F index e081a7b6e4..c80978e702 100644 --- a/phys/module_mp_wsm5.F +++ b/phys/module_mp_wsm5.F @@ -1,7 +1,7 @@ #ifdef _ACCEL # include "module_mp_wsm5_accel.F" #else -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wsm5_accel.F b/phys/module_mp_wsm5_accel.F index 085ef2f441..286e6a14cd 100644 --- a/phys/module_mp_wsm5_accel.F +++ b/phys/module_mp_wsm5_accel.F @@ -1,4 +1,4 @@ -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_mp_wsm7.F b/phys/module_mp_wsm7.F index 8f757f08c5..9b0c777d47 100644 --- a/phys/module_mp_wsm7.F +++ b/phys/module_mp_wsm7.F @@ -1,4 +1,4 @@ -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION # define VREC vsrec # define VSQRT vssqrt #else diff --git a/phys/module_ra_goddard.F b/phys/module_ra_goddard.F index f9387c1a92..fd1118cac2 100644 --- a/phys/module_ra_goddard.F +++ b/phys/module_ra_goddard.F @@ -2062,7 +2062,7 @@ subroutine goddardrad( sw_or_lw, dx & ENDDO -#if (RWORDSIZE == 4) +#ifndef DOUBLE_PRECISION call swrad ( np=dk_half, icb=icb, ict=ict, fcld=dble(fcld1d), & pl=dble(p8w1d), ta=dble(t1d), wa=dble(sh1d), oa=dble(o31d), & taucl=dble(taucl_sw), ssacl=dble(ssacl_sw), asycl=dble(asycl_sw), & @@ -2312,7 +2312,7 @@ subroutine goddardrad( sw_or_lw, dx & ! 1-dimension driver of longwave radiative transfer scheme ! -#if (RWORDSIZE == 4) +#ifndef DOUBLE_PRECISION call lwrad ( np=dk_half, tb=dble(tsfc), ts=dble(tskin), ict=ict, icb=icb,& pl=dble(p8w1d), ta=dble(t1d), wa=dble(sh1d), oa=dble(o31d), & emiss=dble(emis1d), fcld=dble(fcld1d), & diff --git a/phys/module_ra_rrtmg_lw.F b/phys/module_ra_rrtmg_lw.F index 6b5dc2d342..061af5ab26 100644 --- a/phys/module_ra_rrtmg_lw.F +++ b/phys/module_ra_rrtmg_lw.F @@ -35,7 +35,7 @@ module parkind #if (RWORDSIZE == 8) integer, parameter :: kind_rb = selected_real_kind(12) ! 8 byte real #endif -#if (RWORDSIZE == 4) +#ifndef DOUBLE_PRECISION integer, parameter :: kind_rb = selected_real_kind(6) ! 4 byte real #endif #else diff --git a/var/da/da_obs_io/da_read_obs_bufr.inc b/var/da/da_obs_io/da_read_obs_bufr.inc index ca29ceada9..60098764aa 100644 --- a/var/da/da_obs_io/da_read_obs_bufr.inc +++ b/var/da/da_obs_io/da_read_obs_bufr.inc @@ -542,7 +542,7 @@ bufrfile: do ibufr=1,numbufr end if if ( obs(7,1) < r8bfms ) then pwq=nint(qms(7,1)) -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION pwe = min(DBLE(err_pw), oes(7,1)) #else pwe = min(err_pw, oes(7,1)) @@ -604,7 +604,7 @@ bufrfile: do ibufr=1,numbufr !Not currently used !cat=nint(obs(8,k)) -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION toe = min(DBLE(err_t), oes(3,k)) woe = min(DBLE(err_uv), oes(5,k)) qoe = min(DBLE(err_q), oes(2,k)*10.0) ! convert to % from PREPBUFR percent divided by 10 @@ -686,7 +686,7 @@ bufrfile: do ibufr=1,numbufr ! assign u,v,t,q obs errors for synop and metar if ( t29 == 512 .or. t29 == 511 .or. t29 == 514 ) then -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION toe = min(DBLE(err_t), oes(3,1)) woe = min(DBLE(err_uv), oes(5,1)) qoe = min(DBLE(err_q), oes(2,1)*10.0) ! convert to % from PREPBUFR percent divided by 10 diff --git a/var/da/da_par_util/da_proc_maxmin_combine.inc b/var/da/da_par_util/da_proc_maxmin_combine.inc index bd3fe40d13..141586ad9e 100644 --- a/var/da/da_par_util/da_proc_maxmin_combine.inc +++ b/var/da/da_par_util/da_proc_maxmin_combine.inc @@ -32,7 +32,7 @@ subroutine da_proc_maxmin_combine(n, max, min) in(2*i) = myproc end do -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION call mpi_reduce(in, out, n, mpi_2real, mpi_minloc, root, comm, ierr) #else call mpi_reduce(in, out, n, mpi_2double_precision, mpi_minloc, root, comm, ierr) @@ -65,7 +65,7 @@ subroutine da_proc_maxmin_combine(n, max, min) in(2*i-1) = max(i)%value in(2*i) = myproc end do -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION call mpi_reduce(in, out, n, mpi_2real, mpi_maxloc, root, comm, ierr) #else call mpi_reduce(in, out, n, mpi_2double_precision, mpi_maxloc, root, comm, ierr) diff --git a/var/da/da_par_util/da_proc_stats_combine.inc b/var/da/da_par_util/da_proc_stats_combine.inc index d8fd895f57..74573c9300 100644 --- a/var/da/da_par_util/da_proc_stats_combine.inc +++ b/var/da/da_par_util/da_proc_stats_combine.inc @@ -43,7 +43,7 @@ subroutine da_proc_stats_combine(proc_ave, proc_err, proc_min, proc_max, & ! Get minimum value and associated processor index. in(1) = proc_min in(2) = myproc -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION call mpi_reduce(in, out, 1, mpi_2real, mpi_minloc, root, comm, ierr) #else call mpi_reduce(in, out, 1, mpi_2double_precision, mpi_minloc, root, comm, ierr) @@ -73,7 +73,7 @@ subroutine da_proc_stats_combine(proc_ave, proc_err, proc_min, proc_max, & in(1) = proc_max in(2) = myproc -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION call mpi_reduce(in, out, 1, mpi_2real, mpi_maxloc, root, comm, ierr) #else call mpi_reduce(in, out, 1, mpi_2double_precision, mpi_maxloc, root, comm, ierr) diff --git a/var/da/da_radiance/gsi_kinds.f90 b/var/da/da_radiance/gsi_kinds.f90 index 0c0ac7c27c..672a43fb5d 100644 --- a/var/da/da_radiance/gsi_kinds.f90 +++ b/var/da/da_radiance/gsi_kinds.f90 @@ -96,7 +96,7 @@ module gsi_kinds ! Default values ! **** CHANGE THE FOLLOWING TO CHANGE THE DEFAULT REAL TYPE KIND *** ! 1=single, 2=double, 3=quad -#if ( RWORDSIZE == 4 ) +#ifndef DOUBLE_PRECISION integer, parameter, private :: default_real = 1 #else integer, parameter, private :: default_real = 2 diff --git a/wrftladj/module_big_step_utilities_em_ad.F b/wrftladj/module_big_step_utilities_em_ad.F index 8cc13725e9..b4f42ca6b7 100644 --- a/wrftladj/module_big_step_utilities_em_ad.F +++ b/wrftladj/module_big_step_utilities_em_ad.F @@ -11,7 +11,7 @@ MODULE a_module_big_step_utilities_em kfetascheme, mskfscheme, g3scheme, p_qv, param_first_scalar, p_qr, p_qc, DFI_FWD USE module_configure, ONLY : grid_config_rec_type USE module_wrf_error -#if (RWORDSIZE == 4) +#ifndef DOUBLE_PRECISION # define VPOWX vspowx # define VPOW vspow #else diff --git a/wrftladj/module_big_step_utilities_em_tl.F b/wrftladj/module_big_step_utilities_em_tl.F index cab1e5e525..67d79f9b7d 100644 --- a/wrftladj/module_big_step_utilities_em_tl.F +++ b/wrftladj/module_big_step_utilities_em_tl.F @@ -5,7 +5,7 @@ ! and LSEC of ICMSEC, AMSS(2001-2003) ! The copyright of the DFT system was declared by Walls at LASG, 1998-2010 ! ====================================================================================== -#if (RWORDSIZE == 4) +#ifndef DOUBLE_PRECISION # define VPOWX vspowx # define VPOW vspow #else