Prev: KISS4691, a potentially top-ranked RNG.
Next: Ordinary differential equations system: runge-kutta with adaptive step
From: rudra on 25 Jul 2010 10:36 i have defined a kinds as: module kinds implicit none save public integer, parameter:: rdp = selected_real_kind(14,2) integer, parameter:: rsp = selected_real_kind(6,30) integer, parameter:: i1 = selected_int_kind(1) integer, parameter:: i2 = selected_int_kind(3) integer, parameter:: i3 = selected_int_kind(5) integer, parameter:: i4 = selected_int_kind(12) end module kinds which runs fine with my machine. when my collaborator runs this to his machine(I don't exactly know his architecture, but he uses xlf compiler), he is getting error in rdp. I assume, the real precision is not supported in his machine. The point is, I need this precision for some of the variable. Is there anyway to make my code such that it will take the next higher precision supported?
From: Richard Maine on 25 Jul 2010 11:43
rudra <bnrj.rudra(a)gmail.com> wrote: > integer, parameter:: rdp = selected_real_kind(14,2) .... > which runs fine with my machine. when my collaborator runs this to his > machine(I don't exactly know his architecture, but he uses xlf > compiler), he is getting error in rdp. I assume, the real precision is > not supported in his machine. As always when asking for programming help, you should give data instead of your assumptions. I could have sworn this was pointed out to you multiple times before. It sure is regularly pointed out to other people; did you get missed? Show the exact error message - not just the vague statement that it is "getting an error in rdp". I can't even tell what you mean by "in rdp". Does that mean some error in the above line that defines rdp, or does it mean an error in some line that you have not shown, which uses rdp. Those would be competely different. If the error is elsewhere (as I half suspect), then show the code that actualy produces the error message. We can't debug code that we don't see. In any case, show us the exact error message. Given code and an error message, we usually debug it. With only your guess about what the problem is, no error message, and what I half suspect might not be the code where the error happens, there isn't much help I can offer. > The point is, I need this precision for some of the variable. Is there > anyway to make my code such that it will take the next higher > precision supported? That's a bit of an unusual precision requirement (14 decimal digits of accuracy, but a range of only .01 to 100.0). Makes me wonder whether there is a typo there, but that shouldn't bother the compiler. The compiler already *DOES* take the next higher precision. That's what selected_real_kind does. If you are thinking that it makes sure that you get exactly the specified precision, no more and no less, then you are wrong (for all compilers). Only if there is no kind of higher precision do you get an error. And even then, the error would not show up in defining rdp, but in using it.... which would be in code not shown here. So your guess is wrong. But its pretty much all I have for data to help you from. So I guess I can't help. My suspicions wander in all kinds of vague directions, including such things as wondering whether the module got compiled and used appropriately, but that's way too speculative to pursue from the data given. (If that guess is within "miles", I'd think I'd merit "crystal ball credit", but probably no such luck.) -- Richard Maine | Good judgment comes from experience; email: last name at domain . net | experience comes from bad judgment. domain: summertriangle | -- Mark Twain |