Hi Ming,
There are some variables in wrfout that are truncated. I have even tried to build WRF with double-precision (./configure -r8). But it seems that with both, single precision and double precision variables are truncated to some specific digits to the right of the decimal point. (please see a small part of each output below which was produced with the ncl print command)
I think the problem is that when values are written to wrfout they are truncated during fortran write functions.
The reason that I need non-truncated values is that for my dissertation I have implemented a code that pre-rounds values so that they can be added in any order and always get the same result. For example, when doing a sum reduction with MPI_allreduce it won't matter how many nodes are used and in which order the values on the different nodes are added together. This implementation can be inserted in a scientific software where there is a sum reduction computation and will improve reproducibility.
But, the truncation of output values currently in WRF hides the reproducibility problem that occurs in global sum reduction. I have seen no difference between WRF output files when running one MPI tasks or with two, four, eight or sixteen MPI tasks.
What I want is non-truncated output so that the algorithm show how effective it is (what I mean is seeing differences of wrfout when running with different MPI tasks when there is a global sum reduction in the code).I do not know how the WRF source code is structured but need to access as much precision as possible. Is there any file that I can edit to change precision of the variables in wrfout?
In a separate note I mention that I dont have background in atmospheric science. My major is scientific computing and my test case in my research is WRF. So, sorry, if my questions are confessing.
This output is from a single precision build of WRF:
Variable: ZNU
Type: float
Total Size: 480 bytes
120 values
Number of Dimensions: 2
Dimensions and sizes: [Time | 3] x [bottom_top | 40]
Coordinates:
Number Of Attributes: 5
FieldType : 104
MemoryOrder : Z
description : eta values on half (mass) levels
units :
stagger :
.....
.....
(15) 0.3242757
(0,16) 0.2992108
(0,17) 0.2756645
(0,18) 0.2535449
(0,19) 0.2327653
(0,20) 0.2132448
(0,21) 0.1949069
(0,22) 0.1776801
(0,23) 0.161497
(0,24) 0.1462944
(0,28) 0.09415331
(0,29) 0.08303083
(0,30) 0.07258224
(0,31) 0.06276669
(0,32) 0.05354582
(0,33) 0.04488363
(1,20) 0.2132448
(1,21) 0.1949069
(1,22) 0.1776801
(1,23) 0.161497
(1,24) 0.1462944
(1,25) 0.1320128
(1,37) 0.01517455
(1,38) 0.008837154
(1,39) 0.002883723
......
......
This output is from a double precision (./configure -r8) build of WRF:
Variable: ZNU
Type: double
Total Size: 960 bytes
120 values
Number of Dimensions: 2
Dimensions and sizes: [Time | 3] x [bottom_top | 40]
Coordinates:
Number Of Attributes: 5
FieldType : 105
MemoryOrder : Z
description : eta values on half (mass) levels
units :
stagger :
....
....
(0,10) 0.4760370012103428
(0,11) 0.4417773607841126
(0,12) 0.4095934070404194
(0,13) 0.3793593804806093
(0,14) 0.3509571409888741
(0,15) 0.3242757061971813
(0,16) 0.2992108178192592
(0,17) 0.2756645342590774
(0,18) 0.2535448479019325
(0,19) 0.2327653255926935
(0,31) 0.06276667497400183
(0,32) 0.05354581784450729
(0,33) 0.0448836242067233
(0,34) 0.03674624635076922
(0,35) 0.02910188729583686
(1,25) 0.1320128033337337
(1,26) 0.1185965353748981
(1,27) 0.105993118000162
(1,28) 0.09415330308224457
.....
.....
Thank you,
Sara