From ab44106465436c09538540b6621f2f705be8224c Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 16:02:43 -0700 Subject: [PATCH] Replace all instances of #if (RWORDSIZE == 8) with equivalent #ifdef DOUBLE_PRECISION --- frame/module_alloc_space.h | 2 +- frame/module_cpl_oasis3.F | 6 +++--- phys/module_ra_rrtmg_aero_optical_util_cmaq.F | 10 +++++----- phys/module_ra_rrtmg_lw.F | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frame/module_alloc_space.h b/frame/module_alloc_space.h index 56e8bf2f87..4fedc45532 100644 --- a/frame/module_alloc_space.h +++ b/frame/module_alloc_space.h @@ -135,7 +135,7 @@ inter_domain = inter_domain_in okay_to_alloc = okay_to_alloc_in -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION initial_data_value = 0. #else CALL get_initial_data_value ( initial_data_value ) diff --git a/frame/module_cpl_oasis3.F b/frame/module_cpl_oasis3.F index f7d96cecad..896de708e1 100644 --- a/frame/module_cpl_oasis3.F +++ b/frame/module_cpl_oasis3.F @@ -22,7 +22,7 @@ MODULE module_cpl_oasis3 TYPE :: FLD_CPL ! Coupling field information CHARACTER(len = 64) :: clname ! Name of the coupling field, jpeighty defined in oasis INTEGER :: nid ! Id of the field -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION REAL , POINTER, DIMENSION(:,:) :: dbl2d ! 2d array to store received field #else REAL(kind=8), POINTER, DIMENSION(:,:) :: dbl2d ! 2d array to store received field @@ -308,7 +308,7 @@ SUBROUTINE cpl_oasis_snd( kdomwrf, kdomext, kfldid, ksec, pdata ) kdomwrf, kdomext, kfldid, ' ', TRIM(ssnd(kdomwrf,kdomext,kfldid)%clname), ksec CALL wrf_debug(nlevdbg, cltxt) -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION CALL oasis_put(ssnd(kdomwrf,kdomext,kfldid)%nid, ksec, pdata(:,:) , info) #else CALL oasis_put(ssnd(kdomwrf,kdomext,kfldid)%nid, ksec, DBLE(pdata(:,:)), info) @@ -362,7 +362,7 @@ SUBROUTINE cpl_oasis_rcv( kdomwrf, kdomext, kfldid, ksec, pcplrcv ) CALL wrf_debug(nlevdbg, cltxt) CALL oasis_get( srcv(kdomwrf,kdomext,kfldid)%nid, ksec, srcv(kdomwrf,kdomext,kfldid)%dbl2d, info ) -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION pcplrcv(:,:) = srcv(kdomwrf,kdomext,kfldid)%dbl2d #else pcplrcv(:,:) = REAL(srcv(kdomwrf,kdomext,kfldid)%dbl2d, kind=4) diff --git a/phys/module_ra_rrtmg_aero_optical_util_cmaq.F b/phys/module_ra_rrtmg_aero_optical_util_cmaq.F index 7ec0864a4e..48ba55d893 100644 --- a/phys/module_ra_rrtmg_aero_optical_util_cmaq.F +++ b/phys/module_ra_rrtmg_aero_optical_util_cmaq.F @@ -1687,7 +1687,7 @@ SUBROUTINE BHCOAT (XX, YY, RRFRL1, RRFRL2, QQEXT, QQSCA, QBACK, GGSCA, SUCCESS) SUCCESS = .TRUE. -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION II = c_set(0.0, 1.0) #else II = c_set(0.0D0, 1.0D0) @@ -1733,13 +1733,13 @@ SUBROUTINE BHCOAT (XX, YY, RRFRL1, RRFRL2, QQEXT, QQSCA, QBACK, GGSCA, SUCCESS) xi0y = c_sub(psi0y, c_mul(chi0y, II)) xi1y = c_sub(psi1y, c_mul(chi1y, II)) -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION chi0y2 = c_mul(-1.0, c_SIN(y2)) #else chi0y2 = c_mul(-1.0d0, c_SIN(y2)) #endif chi1y2 = c_COS(y2) -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION chi0x2 = c_mul(-1.0, c_SIN(x2)) #else chi0x2 = c_mul(-1.0d0, c_SIN(x2)) @@ -1748,7 +1748,7 @@ SUBROUTINE BHCOAT (XX, YY, RRFRL1, RRFRL2, QQEXT, QQSCA, QBACK, GGSCA, SUCCESS) qsca = 0.0d0 qext = 0.0d0 GSCA = 0.0d0 -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION xback = c_set(0.0, 0.0) #else xback = c_set(0.0d0, 0.0d0) @@ -1806,7 +1806,7 @@ SUBROUTINE BHCOAT (XX, YY, RRFRL1, RRFRL2, QQEXT, QQSCA, QBACK, GGSCA, SUCCESS) (c_ABS(amess3) .LE. del*c_ABS(d1y2)) .AND. & (c_ABS(amess4) .LE. del) ) THEN ! convergence for inner sphere -#if ( RWORDSIZE == 8 ) +#ifdef DOUBLE_PRECISION brack = c_set(0.0,0.0) crack = c_set(0.0,0.0) #else diff --git a/phys/module_ra_rrtmg_lw.F b/phys/module_ra_rrtmg_lw.F index 061af5ab26..fd04a0370c 100644 --- a/phys/module_ra_rrtmg_lw.F +++ b/phys/module_ra_rrtmg_lw.F @@ -32,7 +32,7 @@ module parkind #if 0 ! Modified for WRF: -#if (RWORDSIZE == 8) +#ifdef DOUBLE_PRECISION integer, parameter :: kind_rb = selected_real_kind(12) ! 8 byte real #endif #ifndef DOUBLE_PRECISION