Commit cd003b69 authored by Miguel Tremblay's avatar Miguel Tremblay
Browse files

Removal of CHKDIV function. Division by zero are now explicitly checked into the code.

parent 0ffc2cb7
...@@ -158,8 +158,6 @@ ...@@ -158,8 +158,6 @@
* Internes * Internes
* -------- * --------
*** ***
INTEGER ier, CHKDIV
EXTERNAL CHKDIV
INTEGER next, now INTEGER next, now
REAL T(n,2), G(0:n) REAL T(n,2), G(0:n)
DOUBLE PRECISION FGD, AL, RA, M, DIV DOUBLE PRECISION FGD, AL, RA, M, DIV
...@@ -274,8 +272,7 @@ ...@@ -274,8 +272,7 @@
call SRFHUM ( QG, CL, ER1, ER2, TSK, P0(i), QA(i), FP ) call SRFHUM ( QG, CL, ER1, ER2, TSK, P0(i), QA(i), FP )
* Air density at the surface * Air density at the surface
DIV = RGASD * FOTVT ( TSK , QG ) DIV = RGASD * FOTVT ( TSK , QG )
ier = CHKDIV (DIV, "balanc.f", 196 ) if ( abs(DIV) < 1.0D-5 ) then
if ( ier .eq. 1 ) then
WRITE(*,*) "Echec dans balanc.f" WRITE(*,*) "Echec dans balanc.f"
ECHEC = .true. ECHEC = .true.
return return
......
...@@ -144,8 +144,6 @@ ...@@ -144,8 +144,6 @@
* Internes * Internes
* -------- * --------
*** ***
INTEGER ier, CHKDIV
EXTERNAL CHKDIV
CHARACTER*250 outfmt CHARACTER*250 outfmt
INTEGER next, now, iter INTEGER next, now, iter
LOGICAL DOWN LOGICAL DOWN
...@@ -281,8 +279,7 @@ ...@@ -281,8 +279,7 @@
call SRFHUM ( QG, CL, ER1, ER2, TSK, P0(i), QA(i), FP ) call SRFHUM ( QG, CL, ER1, ER2, TSK, P0(i), QA(i), FP )
* Air density at ground * Air density at ground
DIV = RGASD * FOTVT ( TSK , QG ) DIV = RGASD * FOTVT ( TSK , QG )
ier = CHKDIV (DIV, "coupla.f", 209 ) if ( abs(DIV) < 1.0D-5 ) then
if ( ier .eq. 1 ) then
ECHEC = .true. ECHEC = .true.
WRITE(*,*) "Echec in coupla.f" WRITE(*,*) "Echec in coupla.f"
return return
......
...@@ -167,28 +167,3 @@ ...@@ -167,28 +167,3 @@
return return
end end
************************************************************************
************************************************************************
************************************************************************
***
* Sous-routine CHKDIV: Verifier qu'un denominateur est different
* de zero.
*
* Auteur/Author: Louis-Philippe Crevier
* Date: Octobre 2000
***
FUNCTION CHKDIV (DIV, FICH, LIGNE )
IMPLICIT NONE
INTEGER CHKDIV
INTEGER a
CHARACTER*(*) FICH, LIGNE
DOUBLE PRECISION DIV
if ( abs(DIV) < 1.0D-5 ) then
a=index(FICH,' ')-1
FICH=FICH(1:a)//', '//LIGNE
CHKDIV = 1
else
CHKDIV = 0
end if
return
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment