1 : C CHECSQRT SOURCE AM 12/02/28 21:15:08 7291 2 : Subroutine check_sqrt(x,Name_of_x,Name_of_subr,lerror) 3 : 4 : c This subroutine checks the value of the variable x 4 :
Warning: preg_replace(): Compilation failed: unmatched parentheses at offset 27 in C:\xampp\htdocs\cast3m_kit_local_fr_en_2014\sources.php on line 147
5 : c If (x.lt.0) or if (x is a NaN (Not a Number)), 6 : c then a message is printed and lerror = .true. is returned 7 : 8 : logical lerror 9 : real*8 x 10 : character*20 Name_of_subr,Name_of_x 11 : 12 : lerror = .false. 13 : 14 : if (x.lt.0.d0) then 15 : ** write(2,1)Name_of_subr,Name_of_x,x 16 : write(*,1)Name_of_subr,Name_of_x,x 17 : 1 format(/' ERROR in subroutine ',A20/ 18 : . ' The variable "',A20,'" is negative.'/ 19 : . ' This would create problems because its square 20 : . root will be calculated.'/ 21 : . ' The value of this variable is:',g10.3/) 22 : lerror = .true. 23 : 24 : c elseif (isnan(x)) then 25 : c write(2,2)Name_of_subr,Name_of_x 26 : c write(*,2)Name_of_subr,Name_of_x 27 : c2 format(/' ERROR in subroutine ',A20,'.'/ 28 : c . ' The variable "',A20,'" is a NaN (Not a Number).'/ 29 : c . ' This would create problems because its square 30 : c . root will be calculated.'/) 31 : c lerror = .true. 32 : 33 : else 34 : lerror = .false. 35 : 36 : endif 37 : 38 : 39 : return 40 : end 41 : 42 : 43 :
© Cast3M 2003 - All rights reserved.
Disclaimer