From c7468f07f542e41c67ba2c2d436071801127a503 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 15:52:53 -0700 Subject: [PATCH 01/10] Create configuration define for double precision --- arch/Config.pl | 10 ++++++++++ arch/postamble | 2 +- configure | 15 ++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/arch/Config.pl b/arch/Config.pl index 761c540abe..0c36ddcf12 100644 --- a/arch/Config.pl +++ b/arch/Config.pl @@ -25,6 +25,7 @@ $sw_compileflags=""; $sw_opt_level=""; $sw_rwordsize="\$\(NATIVE_RWORDSIZE\)"; +$sw_promotion=""; $sw_rttov_flag = "" ; $sw_rttov_inc = "" ; $sw_rttov_path = "" ; @@ -228,6 +229,10 @@ { $sw_config_line=substr( $ARGV[0], 13 ) ; } + if ( substr( $ARGV[0], 1, 6 ) eq "rword=" ) + { + $sw_rwordsize=substr( $ARGV[0], 7 ) ; + } shift @ARGV ; } @@ -316,6 +321,10 @@ } $sw_rwordsize = "8" if ( $sw_wrfplus_core eq "-DWRFPLUS=1" ); + if ( $sw_rwordsize eq "8" ) + { + $sw_promotion = "-DDOUBLE_PRECISION" ; + } # A separately-installed ESMF library is required to build the ESMF # implementation of WRF IOAPI in external/io_esmf. This is needed @@ -634,6 +643,7 @@ $_ =~ s/CONFIGURE_LDFLAGS/$sw_ldflags/g ; $_ =~ s/CONFIGURE_COMPILEFLAGS/$sw_compileflags/g ; $_ =~ s/CONFIGURE_RWORDSIZE/$sw_rwordsize/g ; + $_ =~ s/CONFIGURE_PROMOTION/$sw_promotion/g ; $_ =~ s/CONFIGURE_FC/$sw_time $sw_fc/g ; $_ =~ s/CONFIGURE_CC/$sw_cc/g ; $_ =~ s/CONFIGURE_COMMS_LIB/$sw_comms_lib/g ; diff --git a/arch/postamble b/arch/postamble index b5e585d29e..8e8b7769d3 100644 --- a/arch/postamble +++ b/arch/postamble @@ -3,7 +3,7 @@ FGREP = fgrep -iq -ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) \ +ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) CONFIGURE_PROMOTION \ $(ARCH_LOCAL) \ $(DA_ARCHFLAGS) \ CONFIGURE_DMPARALLEL \ diff --git a/configure b/configure index 5e2bedb10f..dd1bbac8b7 100755 --- a/configure +++ b/configure @@ -6,7 +6,7 @@ thiscmd=$0 FORTRAN_COMPILER_TIMER="" opt_level="-f" -rword="-r4" +rword=4 print_usage="" chemistry="" wrf_core="" @@ -22,7 +22,7 @@ while [ $# -ge 1 ]; do -help) print_usage="yes" ;; -os) shift ; WRF_OS=$1 ;; -mach) shift ; WRF_MACH=$1 ;; - -r8) rword="-r8" ;; + -r8) rword=8 ;; -time) shift ; FORTRAN_COMPILER_TIMER=$1 ;; chem) WRF_CHEM=1 ;; cmaq) WRF_CMAQ=1 ;; @@ -529,7 +529,7 @@ if test -n "$wrf_core" ; then if [ "$wrf_core" = "DA_CORE" -o \ "$wrf_core" = "4D_DA_CORE" -o \ "$wrf_core" = "WRF_PLUS_CORE" ] ; then - rword="-r8" + rword=8 fi fi @@ -541,7 +541,7 @@ if test -n "$PERL" ; then -netcdf=$NETCDF -pnetcdf=$PNETCDF -netcdfpar=$NETCDFPAR -adios2=$ADIOS2 -hdf5=$HDF5 -phdf5=$PHDF5 -os=$os -mach=$mach -ldflags=$ldflags \ -compileflags=$compileflags -opt_level=$opt_level -USENETCDFF=$USENETCDFF -USENETCDF=$USENETCDF \ -time=$FORTRAN_COMPILER_TIMER -tfl="$TFL" -cfl="$CFL" -config_line="$config_line" \ - -wrf_core=$wrf_core -gpfs=$GPFS_PATH -curl=$CURL_PATH -netcdf4_dep_lib="$NETCDF4_DEP_LIB" + -wrf_core=$wrf_core -gpfs=$GPFS_PATH -curl=$CURL_PATH -netcdf4_dep_lib="$NETCDF4_DEP_LIB" -rword="$rword" if test ! -f configure.wrf ; then echo "configure.wrf not created! Exiting configure script..." exit 1 @@ -556,13 +556,10 @@ if test -n "$PERL" ; then fi # GNU has a funny way of doing promotion to real*8 - if [ "$rword" = "-r8" ] ; then + if [ $rword -eq 8 ] ; then srch=`grep -i "^SFC" configure.wrf | grep -i "gfortran"` if [ -n "$srch" ] ; then - sed -e '/^PROMOTION/s/#//' \ - -e '/^RWORDSIZE/s/$(NATIVE_RWORDSIZE)/8/' configure.wrf > configure.wrf.edit - else - sed -e '/^RWORDSIZE/s/$(NATIVE_RWORDSIZE)/8/' configure.wrf > configure.wrf.edit + sed -e '/^PROMOTION/s/#//' configure.wrf > configure.wrf.edit fi /bin/mv configure.wrf.edit configure.wrf sed -e 's/-DBUILD_SBM_FAST=1/-DBUILD_SBM_FAST=0/' configure.wrf > configure.wrf.edit From 71f8cc7199d5f3fbeeb18d1df9a852ebbe03f999 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 15:54:38 -0700 Subject: [PATCH 02/10] Replace all instances of #if (RWORDSIZE == 4) with equivalent #ifndef DOUBLE_PRECISION --- dyn_em/module_big_step_utilities_em.F | 2 +- frame/module_clear_halos.F | 2 +- phys/ccpp_kind_types.F | 2 +- phys/module_mp_wdm5.F | 2 +- phys/module_mp_wdm6.F | 2 +- phys/module_mp_wdm7.F | 2 +- phys/module_mp_wsm3.F | 2 +- phys/module_mp_wsm3_accel.F | 2 +- phys/module_mp_wsm5.F | 2 +- phys/module_mp_wsm5_accel.F | 2 +- phys/module_mp_wsm7.F | 2 +- phys/module_ra_goddard.F | 4 ++-- phys/module_ra_rrtmg_lw.F | 2 +- var/da/da_obs_io/da_read_obs_bufr.inc | 6 +++--- var/da/da_par_util/da_proc_maxmin_combine.inc | 4 ++-- var/da/da_par_util/da_proc_stats_combine.inc | 4 ++-- var/da/da_radiance/gsi_kinds.f90 | 2 +- wrftladj/module_big_step_utilities_em_ad.F | 2 +- wrftladj/module_big_step_utilities_em_tl.F | 2 +- 19 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dyn_em/module_big_step_utilities_em.F b/dyn_em/module_big_step_utilities_em.F index 1d24d3cf00..5076959843 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 From f90f67bfa5a6cc06e04e7a7437990564458700c2 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 16:02:43 -0700 Subject: [PATCH 03/10] Replace all instances of #if (RWORDSIZE == 8) with equivalent #ifdef DOUBLE_PRECISION --- frame/module_cpl_oasis3.F | 6 +++--- phys/module_ra_rrtmg_aero_optical_util_cmaq.F | 10 +++++----- phys/module_ra_rrtmg_lw.F | 2 +- tools/gen_allocs.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) 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 diff --git a/tools/gen_allocs.c b/tools/gen_allocs.c index 965a1fc04a..0ab8cd5f64 100644 --- a/tools/gen_allocs.c +++ b/tools/gen_allocs.c @@ -231,7 +231,7 @@ gen_alloc1 ( char * dirname ) " tl = tl_in\n" " inter_domain = inter_domain_in\n" " okay_to_alloc = okay_to_alloc_in\n\n" - "#if ( RWORDSIZE == 8 )\n" + "#ifdef DOUBLE_PRECISION\n" " initial_data_value = 0.\n" "#else\n" " CALL get_initial_data_value ( initial_data_value )\n" From 570f9ac07315f8026593ad38592c551c096f2fc3 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 16:13:46 -0700 Subject: [PATCH 04/10] Replace other less common contructs of querying double precision --- chem/module_phot_tuv.F | 5 ++--- external/RSL_LITE/module_dm.F | 6 +++--- external/ioapi_share/wrf_io_flags.h | 2 +- phys/module_mp_ntu.F | 4 ++-- phys/module_ra_goddard.F | 4 ++-- share/module_check_a_mundo.F | 2 +- var/da/da_control/da_control.f90 | 2 +- var/da/da_par_util/da_par_util1.f90 | 4 ++-- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/chem/module_phot_tuv.F b/chem/module_phot_tuv.F index f37d167a67..0a32c08c00 100644 --- a/chem/module_phot_tuv.F +++ b/chem/module_phot_tuv.F @@ -1457,11 +1457,10 @@ subroutine get_xsqy_tab CALL wrf_dm_bcast_bytes( temp_data, n_temp_data*RWORDSIZE ) CALL wrf_dm_bcast_bytes( o3_data, n_o3_data*RWORDSIZE ) CALL wrf_dm_bcast_bytes( air_dens_data, n_air_dens_data*RWORDSIZE ) -#if RWORDSIZE == 4 +#ifndef DOUBLE_PRECISION CALL wrf_dm_bcast_bytes( chebev_ac, nchebev_term*nchebev_wave*2*RWORDSIZE ) CALL wrf_dm_bcast_bytes( chebev_bc, nchebev_term*nchebev_wave*2*RWORDSIZE ) -#endif -#if RWORDSIZE == 8 +#else CALL wrf_dm_bcast_bytes( chebev_ac, nchebev_term*nchebev_wave*RWORDSIZE ) CALL wrf_dm_bcast_bytes( chebev_bc, nchebev_term*nchebev_wave*RWORDSIZE ) #endif diff --git a/external/RSL_LITE/module_dm.F b/external/RSL_LITE/module_dm.F index ea166ae384..578eccc9d9 100644 --- a/external/RSL_LITE/module_dm.F +++ b/external/RSL_LITE/module_dm.F @@ -78,7 +78,7 @@ MODULE module_dm #endif INTERFACE wrf_dm_maxval -#if ( defined(PROMOTE_FLOAT) || ( RWORDSIZE == DWORDSIZE ) ) +#ifdef DOUBLE_PRECISION MODULE PROCEDURE wrf_dm_maxval_real , wrf_dm_maxval_integer #else MODULE PROCEDURE wrf_dm_maxval_real , wrf_dm_maxval_integer, wrf_dm_maxval_doubleprecision @@ -86,7 +86,7 @@ MODULE module_dm END INTERFACE INTERFACE wrf_dm_minval ! gopal's doing -#if ( defined(PROMOTE_FLOAT) || ( RWORDSIZE == DWORDSIZE ) ) +#ifdef DOUBLE_PRECISION MODULE PROCEDURE wrf_dm_minval_real , wrf_dm_minval_integer #else MODULE PROCEDURE wrf_dm_minval_real , wrf_dm_minval_integer, wrf_dm_minval_doubleprecision @@ -1458,7 +1458,7 @@ SUBROUTINE wrf_dm_minval_real ( val, idex, jdex ) # endif END SUBROUTINE wrf_dm_minval_real -#ifndef PROMOTE_FLOAT +#ifndef DOUBLE_PRECISION SUBROUTINE wrf_dm_maxval_doubleprecision ( val, idex, jdex ) # ifndef STUBMPI IMPLICIT NONE diff --git a/external/ioapi_share/wrf_io_flags.h b/external/ioapi_share/wrf_io_flags.h index a131b5484d..67bb0a02a0 100644 --- a/external/ioapi_share/wrf_io_flags.h +++ b/external/ioapi_share/wrf_io_flags.h @@ -4,7 +4,7 @@ integer, parameter :: WRF_FILE_OPENED_FOR_READ = 103 integer, parameter :: WRF_REAL = 104 integer, parameter :: WRF_DOUBLE = 105 -#ifdef PROMOTE_FLOAT +#ifdef DOUBLE_PRECISION integer, parameter :: WRF_FLOAT=WRF_DOUBLE #else integer, parameter :: WRF_FLOAT=WRF_REAL diff --git a/phys/module_mp_ntu.F b/phys/module_mp_ntu.F index d4fc4ee33d..001bd60c97 100644 --- a/phys/module_mp_ntu.F +++ b/phys/module_mp_ntu.F @@ -661,9 +661,9 @@ REAL FUNCTION GAMLN(XX) ! Referred to y = y+1.D0 ser = ser+cof(J)/y ENDDO -#if (DWORDSIZE == 8 && RWORDSIZE == 8) +#ifdef DOUBLE_PRECISION GAMLN = TMP+LOG(stp*ser/X) -#elif (DWORDSIZE == 8 && RWORDSIZE == 4) +#else GAMLN = SNGL(TMP+LOG(stp*ser/X)) #else ! This is a temporary hack assuming double precision is 8 bytes. diff --git a/phys/module_ra_goddard.F b/phys/module_ra_goddard.F index fd1118cac2..402491dc1a 100644 --- a/phys/module_ra_goddard.F +++ b/phys/module_ra_goddard.F @@ -2069,7 +2069,7 @@ subroutine goddardrad( sw_or_lw, dx & taual=dble(taual_sw), ssaal=dble(ssaal_sw), asyal=dble(asyal_sw), & cosz=dble(cosz), rsuvbm=dble(rsuvbm), rsuvdf=dble(rsuvdf), rsirbm=dble(rsirbm), rsirdf=dble(rsirdf),& flx_out=flx, flxd_out=flxd,flxu_out=flxu, flxd_surf = flxd_surf, lmask=lmask, irestrict=min(CHUNK,ite-ii+1) ) -#elif (RWORDSIZE == 8) +#else call swrad ( np=dk_half, icb=icb, ict=ict, fcld=fcld1d, & pl=p8w1d, ta=t1d, wa=sh1d, oa=o31d, & taucl=taucl_sw, ssacl=ssacl_sw, asycl=asycl_sw, & @@ -2319,7 +2319,7 @@ subroutine goddardrad( sw_or_lw, dx & taucl=dble(taucl_lw), ssacl=dble(ssacl_lw), asycl=dble(asycl_lw), & taual=dble(taual_lw), ssaal=dble(ssaal_lw), asyal=dble(asyal_lw), & flx_out=flx, acflxd_out=flxd, acflxu_out=flxu, irestrict=min(CHUNK,ite-ii+1) ) -#elif (RWORDSIZE == 8) +#else call lwrad ( np=dk_half, tb=tsfc, ts=tskin, ict=ict, icb=icb,& pl=p8w1d, ta=t1d, wa=sh1d, oa=o31d, & emiss=emis1d, fcld=fcld1d, & diff --git a/share/module_check_a_mundo.F b/share/module_check_a_mundo.F index 8ad4e88a6d..0bc9c2f37e 100644 --- a/share/module_check_a_mundo.F +++ b/share/module_check_a_mundo.F @@ -671,7 +671,7 @@ END FUNCTION bep_bem_ngr_u !----------------------------------------------------------------------- ! There is a binary file for Goddard radiation. It is single precision. !----------------------------------------------------------------------- -# if ( defined(PROMOTE_FLOAT) || ( RWORDSIZE == DWORDSIZE ) ) +# ifdef DOUBLE_PRECISION god_r8 : DO i = 1, model_config_rec % max_dom IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE IF ( ( model_config_rec % ra_lw_physics(i) == goddardlwscheme ) .OR. & diff --git a/var/da/da_control/da_control.f90 b/var/da/da_control/da_control.f90 index 46810d7bec..6b9a6f93e2 100644 --- a/var/da/da_control/da_control.f90 +++ b/var/da/da_control/da_control.f90 @@ -99,7 +99,7 @@ module da_control !hcl-note: should the top and interval be namelist options? integer, parameter :: interpolate_level = 2000 -#if RWORDSIZE==8 +#ifdef DOUBLE_PRECISION real, parameter :: da_zero = 0D0 #else real, parameter :: da_zero = 0.0 diff --git a/var/da/da_par_util/da_par_util1.f90 b/var/da/da_par_util/da_par_util1.f90 index 3dce88fb24..bea5a672c0 100644 --- a/var/da/da_par_util/da_par_util1.f90 +++ b/var/da/da_par_util/da_par_util1.f90 @@ -3,7 +3,7 @@ module da_par_util1 use da_control, only : rootproc, ierr, comm, root #ifdef DM_PARALLEL -#if ( DWORDSIZE != RWORDSIZE ) +#ifndef DOUBLE_PRECISION ! use mpi, only : mpi_sum, mpi_integer, mpi_complex, mpi_real #else ! use mpi, only : mpi_sum, mpi_integer, mpi_double_complex, mpi_real8 @@ -21,7 +21,7 @@ module da_par_util1 #ifdef DM_PARALLEL include 'mpif.h' -#if ( DWORDSIZE != RWORDSIZE ) +#ifndef DOUBLE_PRECISION integer, parameter :: true_mpi_real = mpi_real integer, parameter :: true_mpi_complex = mpi_complex #else From 4d3f10a89127831676d423252e844fafc9f0cdae Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 16:19:34 -0700 Subject: [PATCH 05/10] Replace all #if ( RWORDSIZE == DWORDSIZE ) with equivalend #ifdef DOUBLE_PRECISION --- arch/md_calls.inc | 322 +++++++++++++++++------------------ frame/md_calls.m4 | 24 +-- phys/module_ra_cam_support.F | 2 +- 3 files changed, 174 insertions(+), 174 deletions(-) diff --git a/arch/md_calls.inc b/arch/md_calls.inc index 88e0722fbb..11b6e3be24 100644 --- a/arch/md_calls.inc +++ b/arch/md_calls.inc @@ -258,7 +258,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -280,7 +280,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -291,7 +291,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -301,7 +301,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -311,7 +311,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -321,7 +321,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -331,7 +331,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -342,7 +342,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -365,7 +365,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -388,7 +388,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -472,7 +472,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -494,7 +494,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -505,7 +505,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -515,7 +515,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -525,7 +525,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -535,7 +535,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -545,7 +545,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -556,7 +556,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -579,7 +579,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -602,7 +602,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_dom_ti_double ( Hndl, Element, Data, & locCount, Outcount, Status ) # else @@ -688,7 +688,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -710,7 +710,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -721,7 +721,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -731,7 +731,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -741,7 +741,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -751,7 +751,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -761,7 +761,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -772,7 +772,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -795,7 +795,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -818,7 +818,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -902,7 +902,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -924,7 +924,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -935,7 +935,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -945,7 +945,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -955,7 +955,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -965,7 +965,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -975,7 +975,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -986,7 +986,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -1009,7 +1009,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -1032,7 +1032,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_dom_ti_double ( Hndl, Element, Data, & locCount, Status ) # else @@ -3431,7 +3431,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3453,7 +3453,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3464,7 +3464,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3474,7 +3474,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3484,7 +3484,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3494,7 +3494,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3504,7 +3504,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3515,7 +3515,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3538,7 +3538,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3561,7 +3561,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3645,7 +3645,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3667,7 +3667,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3678,7 +3678,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3688,7 +3688,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3698,7 +3698,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3708,7 +3708,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3718,7 +3718,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3729,7 +3729,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3752,7 +3752,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3775,7 +3775,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Outcount, Status ) # else @@ -3861,7 +3861,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3883,7 +3883,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3894,7 +3894,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3904,7 +3904,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3914,7 +3914,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3924,7 +3924,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3934,7 +3934,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3945,7 +3945,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3968,7 +3968,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -3991,7 +3991,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4075,7 +4075,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4097,7 +4097,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4108,7 +4108,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4118,7 +4118,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4128,7 +4128,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4138,7 +4138,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4148,7 +4148,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4159,7 +4159,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4182,7 +4182,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -4205,7 +4205,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_dom_td_double ( Hndl, Element, DateStr, Data, & locCount, Status ) # else @@ -6604,7 +6604,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6626,7 +6626,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6637,7 +6637,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6647,7 +6647,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6657,7 +6657,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6667,7 +6667,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6677,7 +6677,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6688,7 +6688,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6711,7 +6711,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6734,7 +6734,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6818,7 +6818,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6840,7 +6840,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6851,7 +6851,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6861,7 +6861,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PIO CASE ( IO_PIO ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6871,7 +6871,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6881,7 +6881,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6891,7 +6891,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6901,7 +6901,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6912,7 +6912,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6935,7 +6935,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -6958,7 +6958,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Outcount, Status ) # else @@ -7044,7 +7044,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7066,7 +7066,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7077,7 +7077,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7087,7 +7087,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7097,7 +7097,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7107,7 +7107,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7117,7 +7117,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7128,7 +7128,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7151,7 +7151,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7174,7 +7174,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7258,7 +7258,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7280,7 +7280,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7291,7 +7291,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7301,7 +7301,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7311,7 +7311,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7321,7 +7321,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7331,7 +7331,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7342,7 +7342,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7365,7 +7365,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -7388,7 +7388,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_var_ti_double ( Hndl, Element, Varname, Data, & locCount, Status ) # else @@ -9787,7 +9787,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9809,7 +9809,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9820,7 +9820,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9830,7 +9830,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9840,7 +9840,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9850,7 +9850,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9860,7 +9860,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9871,7 +9871,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9894,7 +9894,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -9917,7 +9917,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10001,7 +10001,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10023,7 +10023,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10034,7 +10034,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10044,7 +10044,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10054,7 +10054,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10064,7 +10064,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10074,7 +10074,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10085,7 +10085,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10108,7 +10108,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10131,7 +10131,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Outcount, Status ) # else @@ -10217,7 +10217,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10239,7 +10239,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10250,7 +10250,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10260,7 +10260,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10270,7 +10270,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10280,7 +10280,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10290,7 +10290,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10301,7 +10301,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10324,7 +10324,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10347,7 +10347,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10431,7 +10431,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef NETCDF CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncd_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10453,7 +10453,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_ncdpar_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10464,7 +10464,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef PNETCDF CASE ( IO_PNETCDF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_pnc_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10474,7 +10474,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef PHDF5 CASE ( IO_PHDF5 ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_phdf5_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10484,7 +10484,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef ESMFIO CASE ( IO_ESMF ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_esmf_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10494,7 +10494,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef XXX CASE ( IO_XXX ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_xxx_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10504,7 +10504,7 @@ IF ( Hndl .GT. -1 ) THEN #endif #ifdef YYY CASE ( IO_YYY ) -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_yyy_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10515,7 +10515,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB1 CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr1_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10538,7 +10538,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef GRIB2 CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_gr2_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else @@ -10561,7 +10561,7 @@ IF ( Hndl .GT. -1 ) THEN #ifdef INTIO CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION CALL ext_int_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, & locCount, Status ) # else diff --git a/frame/md_calls.m4 b/frame/md_calls.m4 index 73ce5deef3..69ac289910 100644 --- a/frame/md_calls.m4 +++ b/frame/md_calls.m4 @@ -62,7 +62,7 @@ IF ( Hndl .GT. -1 ) THEN CASE ( IO_NETCDF ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_ncd_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -87,7 +87,7 @@ ifelse($3,real, #ifdef NETCDFPAR CASE ( IO_NETCDFPAR ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_ncdpar_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -101,7 +101,7 @@ ifelse($3,real, #ifdef PNETCDF CASE ( IO_PNETCDF ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_pnc_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -114,7 +114,7 @@ ifelse($3,real, #ifdef ADIOS2 CASE ( IO_ADIOS2 ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_adios2_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -127,7 +127,7 @@ ifelse($3,real, #ifdef PIO CASE ( IO_PIO ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_pio_$1_$2_$6_double$4_$5 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -140,7 +140,7 @@ ifelse($3,real, #ifdef PHDF5 CASE ( IO_PHDF5 ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_phdf5_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -153,7 +153,7 @@ ifelse($3,real, #ifdef ESMFIO CASE ( IO_ESMF ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_esmf_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -166,7 +166,7 @@ ifelse($3,real, #ifdef XXX CASE ( IO_XXX ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_xxx_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -179,7 +179,7 @@ ifelse($3,real, #ifdef YYY CASE ( IO_YYY ) ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_yyy_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -193,7 +193,7 @@ ifelse($3,real, CASE ( IO_GRIB1 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_gr1_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -219,7 +219,7 @@ ifelse($3,real, CASE ( IO_GRIB2 ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_gr2_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else @@ -245,7 +245,7 @@ ifelse($3,real, CASE ( IO_INTIO ) IF ( multi_files(io_form) .OR. wrf_dm_on_monitor() ) THEN ifelse($3,real, -`# if ( RWORDSIZE == DWORDSIZE ) +`# ifdef DOUBLE_PRECISION CALL ext_int_$1_$2_$6_double$4 ( Hndl, Element, ifelse($6,td,`DateStr,') ifelse($2,var,`Varname,') Data, & ifelse($4,char,,`locCount, ifelse($1,get,`Outcount,')') Status ) # else diff --git a/phys/module_ra_cam_support.F b/phys/module_ra_cam_support.F index 4e71f21dcd..86c1ffd501 100644 --- a/phys/module_ra_cam_support.F +++ b/phys/module_ra_cam_support.F @@ -3517,7 +3517,7 @@ subroutine oznini(ozmixm,pin,levsiz,num_months,XLAT, & #if ( defined( DM_PARALLEL ) && ( ! defined( STUBMPI ) ) ) endif if_master call wrf_debug(1,"Broadcast ozone to other ranks.") -# if ( RWORDSIZE == DWORDSIZE ) +# ifdef DOUBLE_PRECISION call MPI_Bcast(ozmixin,size(ozmixin),MPI_DOUBLE_PRECISION,0,local_communicator,ierr) call MPI_Bcast(pin,size(pin),MPI_DOUBLE_PRECISION,0,local_communicator,ierr) plev=pin From d327aa1d38068c04c842023598420d6aa5ff69b7 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Fri, 23 Aug 2024 16:32:51 -0700 Subject: [PATCH 06/10] Change usage of RWORDSIZE in build to use DOUBLE_PRECISION definition --- Makefile | 4 ++-- arch/postamble | 2 ++ external/ioapi_share/makefile | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2bdff94d81..5208ed1f9a 100644 --- a/Makefile +++ b/Makefile @@ -595,7 +595,7 @@ em_real : wrf ln -sf ../../run/ishmael-qi-qr.bin . ; \ ln -sf ../../run/BROADBAND_CLOUD_GODDARD.bin . ; \ ln -sf ../../run/STOCHPERT.TBL . ; \ - if [ $(RWORDSIZE) -eq 8 ] ; then \ + if [ -n $(DOUBLE_PRECISION) ] ; then \ ln -sf ../../run/ETAMPNEW_DATA_DBL ETAMPNEW_DATA ; \ ln -sf ../../run/ETAMPNEW_DATA.expanded_rain_DBL ETAMPNEW_DATA.expanded_rain ; \ ln -sf ../../run/RRTM_DATA_DBL RRTM_DATA ; \ @@ -677,7 +677,7 @@ em_real : wrf ln -sf ../../run/ishmael-qi-qr.bin . ; \ ln -sf ../../run/BROADBAND_CLOUD_GODDARD.bin . ; \ ln -sf ../../run/STOCHPERT.TBL . ; \ - if [ $(RWORDSIZE) -eq 8 ] ; then \ + if [ -n $(DOUBLE_PRECISION) ] ; then \ ln -sf ../../run/ETAMPNEW_DATA_DBL ETAMPNEW_DATA ; \ ln -sf ../../run/ETAMPNEW_DATA.expanded_rain_DBL ETAMPNEW_DATA.expanded_rain ; \ ln -sf ../../run/RRTM_DATA_DBL RRTM_DATA ; \ diff --git a/arch/postamble b/arch/postamble index 8e8b7769d3..e1ee86aaaa 100644 --- a/arch/postamble +++ b/arch/postamble @@ -2,6 +2,8 @@ # POSTAMBLE FGREP = fgrep -iq +### Used throughout the build system to inform promotion to double precision +DOUBLE_PRECISION = CONFIGURE_PROMOTION ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) CONFIGURE_PROMOTION \ $(ARCH_LOCAL) \ diff --git a/external/ioapi_share/makefile b/external/ioapi_share/makefile index a5142e02af..9548bb3dd0 100644 --- a/external/ioapi_share/makefile +++ b/external/ioapi_share/makefile @@ -8,7 +8,7 @@ all: ../../inc/wrf_io_flags.h ../../inc/wrf_status_codes.h ../../inc/wrf_io_flags.h : wrf_io_flags.h ../../configure.wrf ( /bin/rm -f ../../inc/wrf_io_flags.h foo_io_flags.h; \ /bin/cp wrf_io_flags.h foo_io_flags.h; \ - if [ $(RWORDSIZE) -ne $(NATIVE_RWORDSIZE) ] ; then \ + if [ -n $(DOUBLE_PRECISION) ] ; then \ /bin/rm -f foo_io_flags.h; \ sed -e 's/104/105/' wrf_io_flags.h > foo_io_flags.h ;\ fi ; \ From 3e67a13674e652f39eab5b0557ed88f6f94942be Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Mon, 26 Aug 2024 14:50:44 -0700 Subject: [PATCH 07/10] Updates to ensure CMake build works --- CMakeLists.txt | 3 +++ phys/module_mp_ntu.F | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd0264b72..0290bb9765 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -678,6 +678,9 @@ list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS # Only define if set, this is to use #ifdef/#ifndef preprocessors # in code since cmake cannot handle basically any others :( # https://gitlab.kitware.com/cmake/cmake/-/issues/17398 +if ( ${USE_DOUBLE} ) + list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS DOUBLE_PRECISION ) +endif() if ( ${ENABLE_CHEM} ) list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS WRF_CHEM=1 ) if ( ${ENABLE_KPP} ) diff --git a/phys/module_mp_ntu.F b/phys/module_mp_ntu.F index 001bd60c97..5629d63415 100644 --- a/phys/module_mp_ntu.F +++ b/phys/module_mp_ntu.F @@ -665,8 +665,6 @@ REAL FUNCTION GAMLN(XX) ! Referred to GAMLN = TMP+LOG(stp*ser/X) #else GAMLN = SNGL(TMP+LOG(stp*ser/X)) -#else -! This is a temporary hack assuming double precision is 8 bytes. #endif END FUNCTION GAMLN From 4bf576b16a8b05952151046a98ff0b9bed105b80 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Tue, 27 Aug 2024 12:50:08 -0700 Subject: [PATCH 08/10] Ensure old behavior is adhered to --- external/io_int/io_int.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/external/io_int/io_int.F90 b/external/io_int/io_int.F90 index ab95b49a45..7be1bc04ce 100644 --- a/external/io_int/io_int.F90 +++ b/external/io_int/io_int.F90 @@ -1529,12 +1529,12 @@ SUBROUTINE ext_int_read_field ( DataHandle , DateStr , VarName , Field , FieldTy locMemoryStart , locMemoryEnd , & locPatchStart , locPatchEnd ) IF ( TRIM(locVarName) .EQ. TRIM(VarName) ) THEN - IF ( FieldType .EQ. WRF_REAL ) THEN + IF ( FieldType .EQ. WRF_FLOAT ) THEN CALL rfieldread( DataHandle, Field, MemoryStart, MemoryEnd, PatchStart, PatchEnd ) ELSE IF ( FieldType .EQ. WRF_INTEGER ) THEN CALL ifieldread( DataHandle, Field, MemoryStart, MemoryEnd, PatchStart, PatchEnd ) ELSE - CALL wrf_message('io_int.F90: ext_int_read_field: types other than WRF_REAL not supported yet') + CALL wrf_message('io_int.F90: ext_int_read_field: types other than WRF_FLOAT not supported yet') READ( unit=DataHandle ) ENDIF ELSE @@ -1602,7 +1602,7 @@ SUBROUTINE ext_int_write_field ( DataHandle , DateStr , VarName , Field , FieldT inttypesize = itypesize realtypesize = rtypesize - IF ( FieldType .EQ. WRF_REAL .OR. FieldType .EQ. WRF_DOUBLE) THEN + IF ( FieldType .EQ. WRF_FLOAT .OR. FieldType .EQ. WRF_DOUBLE) THEN typesize = rtypesize ELSE IF ( FieldType .EQ. WRF_DOUBLE ) THEN CALL wrf_error_fatal( 'io_int.F90: ext_int_write_field, WRF_DOUBLE not yet supported') @@ -1621,7 +1621,7 @@ SUBROUTINE ext_int_write_field ( DataHandle , DateStr , VarName , Field , FieldT MemoryStart , MemoryEnd , & PatchStart , PatchEnd ) WRITE( unit=DataHandle ) hdrbuf - IF ( FieldType .EQ. WRF_REAL ) THEN + IF ( FieldType .EQ. WRF_FLOAT ) THEN CALL rfieldwrite( DataHandle, Field, MemoryStart, MemoryEnd, PatchStart, PatchEnd ) ELSE IF ( FieldType .EQ. WRF_INTEGER ) THEN CALL ifieldwrite( DataHandle, Field, MemoryStart, MemoryEnd, PatchStart, PatchEnd ) From 9a5cfa82b2b8bb1f8b16a68ff6c2d7631bf7b035 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Tue, 27 Aug 2024 16:26:44 -0700 Subject: [PATCH 09/10] Remove sed rewrite of io flags --- external/ioapi_share/makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/external/ioapi_share/makefile b/external/ioapi_share/makefile index 9548bb3dd0..49893377cc 100644 --- a/external/ioapi_share/makefile +++ b/external/ioapi_share/makefile @@ -6,13 +6,8 @@ all: ../../inc/wrf_io_flags.h ../../inc/wrf_status_codes.h # The if statement below modifies WRF data type codes for builds made with # compiler autopromotion of REAL -> DOUBLE. ../../inc/wrf_io_flags.h : wrf_io_flags.h ../../configure.wrf - ( /bin/rm -f ../../inc/wrf_io_flags.h foo_io_flags.h; \ - /bin/cp wrf_io_flags.h foo_io_flags.h; \ - if [ -n $(DOUBLE_PRECISION) ] ; then \ - /bin/rm -f foo_io_flags.h; \ - sed -e 's/104/105/' wrf_io_flags.h > foo_io_flags.h ;\ - fi ; \ - /bin/mv foo_io_flags.h ../../inc/wrf_io_flags.h ) + /bin/rm -f ../../inc/wrf_io_flags.h + /bin/cp wrf_io_flags.h ../../inc/wrf_io_flags.h ../../inc/wrf_status_codes.h : wrf_status_codes.h /bin/rm -f ../../inc/wrf_status_codes.h From 091c550bfd71caf558961739ac9323c0185ea3f7 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Wed, 28 Aug 2024 17:17:59 -0700 Subject: [PATCH 10/10] Wrap string expansion to evaluate properly --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5208ed1f9a..6fc8f380be 100644 --- a/Makefile +++ b/Makefile @@ -595,7 +595,7 @@ em_real : wrf ln -sf ../../run/ishmael-qi-qr.bin . ; \ ln -sf ../../run/BROADBAND_CLOUD_GODDARD.bin . ; \ ln -sf ../../run/STOCHPERT.TBL . ; \ - if [ -n $(DOUBLE_PRECISION) ] ; then \ + if [ -n "$(DOUBLE_PRECISION)" ] ; then \ ln -sf ../../run/ETAMPNEW_DATA_DBL ETAMPNEW_DATA ; \ ln -sf ../../run/ETAMPNEW_DATA.expanded_rain_DBL ETAMPNEW_DATA.expanded_rain ; \ ln -sf ../../run/RRTM_DATA_DBL RRTM_DATA ; \ @@ -677,7 +677,7 @@ em_real : wrf ln -sf ../../run/ishmael-qi-qr.bin . ; \ ln -sf ../../run/BROADBAND_CLOUD_GODDARD.bin . ; \ ln -sf ../../run/STOCHPERT.TBL . ; \ - if [ -n $(DOUBLE_PRECISION) ] ; then \ + if [ -n "$(DOUBLE_PRECISION)" ] ; then \ ln -sf ../../run/ETAMPNEW_DATA_DBL ETAMPNEW_DATA ; \ ln -sf ../../run/ETAMPNEW_DATA.expanded_rain_DBL ETAMPNEW_DATA.expanded_rain ; \ ln -sf ../../run/RRTM_DATA_DBL RRTM_DATA ; \