From bea1f37efbec6a518a908b5cbaad6d18d8211558 Mon Sep 17 00:00:00 2001 From: Janni Yuval Date: Mon, 30 Nov 2020 17:48:43 -0700 Subject: [PATCH] add comment about how we round at tie breaking case --- .../.nn_convection_flux.f90.swp | Bin 0 -> 16384 bytes .../nn_convection_flux.f90 | 3 ++- .../nn_diffusion.f90 | 5 +++-- .../nn_convection_flux.f90 | 3 ++- .../nn_diffusion.f90 | 3 ++- .../.nn_diffusion.f90.swp | Bin 16384 -> 0 bytes .../nn_convection_flux.f90 | 3 ++- .../nn_diffusion.f90 | 3 ++- .../nn_convection_flux.f90 | 3 ++- .../nn_diffusion.f90 | 3 ++- 10 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/.nn_convection_flux.f90.swp delete mode 100644 sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/.nn_diffusion.f90.swp diff --git a/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/.nn_convection_flux.f90.swp b/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/.nn_convection_flux.f90.swp new file mode 100644 index 0000000000000000000000000000000000000000..4ffa6870be0a417e04fa4f9a69115fe1eb5efb4c GIT binary patch literal 16384 zcmeI3UyLM09mfm#=W*O|f{{dt`KY zP+h(M08LDc{}PS*;EOLx0_uye@W7F%L=#LTg!rbu_$2c80Zlx>Z`Jhd^bU9I&9QG+ zoqRIYRloZ8?dtm1HPQT6SHDchT8j+V5ysy5@eAS4-n#toD}Q0^Bv(pq*?iG5q7&nH!nmnr%M&4G80AEzAfy_qL6AWjHD^T zyfmRyVXm^RIi(O)t&7;m9QIkc*-G!2-=hdV*eh@mD{zP{blUD6Ir_O7y6)NsE@CZw z)x82<0k42pz$@St@CtYZyaE@W0%mXp`zEUWv8w8-`n_c0_x z`xW>p_!3wJp9KH7im~5-5_|z11b;oi*e^f^j)DJu9Q6RF!4JTL;3n|)mGB3r!MDH( za2(tL4ueDBYVi9jP%r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``v!+cjrMscPa!`nc{!#z3}681D!NSRyPfsAH{yP@@1g)lp@qH1RkRcfi+v?7Dg z2%}KsP}K%`+jOH9m+Hbiv6*2_HmS5Sjf&({vjrX3$dwP}sg)MRYGNY{f1ZaDP6Zof Kn8AFY4EsNI5;h_L literal 0 HcmV?d00001 diff --git a/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_convection_flux.f90 b/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_convection_flux.f90 index 98bf22a..c649e99 100644 --- a/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_convection_flux.f90 +++ b/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_convection_flux.f90 @@ -531,6 +531,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -547,7 +548,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_diffusion.f90 b/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_diffusion.f90 index 1b2f31a..ec2d81c 100644 --- a/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_diffusion.f90 +++ b/sam_code_NN/sam_cases/run_files_16_missing_bits_out_in_only/nn_diffusion.f90 @@ -421,7 +421,8 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. - do ib=0,nt + !round x down + do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -438,7 +439,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_convection_flux.f90 b/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_convection_flux.f90 index a4caf67..4085204 100644 --- a/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_convection_flux.f90 +++ b/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_convection_flux.f90 @@ -531,6 +531,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -547,7 +548,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_diffusion.f90 b/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_diffusion.f90 index 805b5f6..044988e 100644 --- a/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_diffusion.f90 +++ b/sam_code_NN/sam_cases/run_files_18_missing_bits_out_in_only/nn_diffusion.f90 @@ -421,6 +421,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -438,7 +439,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/.nn_diffusion.f90.swp b/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/.nn_diffusion.f90.swp deleted file mode 100644 index 1e07df5ed31dcc5d6e4f6615a6ac3f5c4b5e43b6..0000000000000000000000000000000000000000 GIT binary patch literal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WCP74HuFj}pD=w<3;uL+%Q$=o#{{l-I Bg2ey; diff --git a/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_convection_flux.f90 b/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_convection_flux.f90 index 8327071..da8bfe6 100644 --- a/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_convection_flux.f90 +++ b/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_convection_flux.f90 @@ -531,6 +531,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -547,7 +548,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_diffusion.f90 b/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_diffusion.f90 index 590ad58..8b1011a 100644 --- a/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_diffusion.f90 +++ b/sam_code_NN/sam_cases/run_files_20_missing_bits_out_in_only/nn_diffusion.f90 @@ -421,6 +421,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -438,7 +439,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_convection_flux.f90 b/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_convection_flux.f90 index 852d075..de4fb86 100644 --- a/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_convection_flux.f90 +++ b/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_convection_flux.f90 @@ -531,6 +531,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -547,7 +548,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp diff --git a/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_diffusion.f90 b/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_diffusion.f90 index dff0fc4..f57659d 100644 --- a/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_diffusion.f90 +++ b/sam_code_NN/sam_cases/run_files_22_missing_bits_out_in_only/nn_diffusion.f90 @@ -421,6 +421,7 @@ subroutine f_trunc_32( x ) ! bits 23-30 are exponent ! bits 0-22 are the mantissa, least significant bits are 0-7. +!round x down do ib=0,nt itemp = ibclr(itemp,ib) ! bit to zero enddo @@ -438,7 +439,7 @@ subroutine f_trunc_32( x ) endif enddo - if (abs(temp2 -x) < abs(temp-x)) then + if (abs(temp2 -x) < abs(temp-x)) then !tie breaking rule -> round toward zero x = temp2 else x = temp