Changeset 71 in lmdz_wrf


Ignore:
Timestamp:
Jul 24, 2014, 2:32:26 PM (10 years ago)
Author:
lfita
Message:

Removing subroutine 'check_var' definitions?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LMDZ_WRFmeas/WRFV3/lmdz/calltherm.F90

    r70 r71  
    464464
    465465      end
    466 
    467 SUBROUTINE check_var(funcn, varn, var, sizev, bigvalue, stoprun)
    468 !  Subroutine to check the consistency of a variable
    469 !    * NaN value: by definition is variable /= variable
    470 !    * bigvalue: threshold for the variable
    471 
    472   IMPLICIT NONE
    473 
    474 #include "dimensions.h"
    475 
    476   INTEGER, INTENT(IN)                                    :: sizev
    477   CHARACTER(LEN=50), INTENT(IN)                          :: funcn, varn
    478   REAL, DIMENSION(sizev), INTENT(IN)                     :: var
    479   REAL, INTENT(IN)                                       :: bigvalue
    480   LOGICAL, INTENT(IN)                                    :: stoprun
    481 
    482 ! Local
    483   INTEGER                                                :: i, wrongi, xpt, ypt
    484   CHARACTER(LEN=50)                                      :: errmsg
    485   LOGICAL                                                :: found
    486   REAL, DIMENSION(sizev)                                 :: wrongvalues
    487   INTEGER, DIMENSION(sizev)                              :: wronggridpt
    488 
    489 !!!!!!! Variables
    490 ! funcn: at which functino of part of the program variable is checked
    491 ! varn: name of the variable
    492 ! var: variable to check
    493 ! sizev: size of the variable
    494 ! bigvalue: biggest attenaible value for the variable
    495 ! stoprun: Should the run stop if it founds a problem?
    496 
    497   errmsg = 'ERROR -- error -- ERROR -- error'
    498 
    499   found = .FALSE.
    500   wrongi = 0
    501   DO i=1,sizev
    502     IF (var(i) /= var(i) .OR. ABS(var(i)) > bigvalue ) THEN
    503       IF (wrongi == 0) found = .TRUE.
    504       wrongi = wrongi + 1
    505       wrongvalues(wrongi) = var(i)
    506       wronggridpt(wrongi) = i
    507     END IF
    508   END DO
    509 
    510   IF (found) THEN
    511     PRINT *,TRIM(errmsg)
    512     PRINT *,"  at '" // TRIM(funcn) // "' variable '" //TRIM(varn)//                 &
    513       "' is wrong in Nvalues= ",wrongi,' at i (x, y) value___'
    514     DO i=1,wrongi
    515        ypt = INT(wronggridpt(i)/wiim) + 1
    516        xpt = wronggridpt(i) - (ypt-1)*wiim
    517       PRINT *,wronggridpt(i), '(',xpt,', ',ypt,')', wrongvalues(i)
    518     END DO
    519     IF (stoprun) THEN
    520       STOP
    521     END IF
    522   END IF
    523 
    524   RETURN
    525 
    526 END SUBROUTINE check_var
    527 
    528 SUBROUTINE check_var3D(funcn, varn, var, sizev, zsize, bigvalue, stoprun)
    529 !  Subroutine to check the consistency of a 3D LMDSZ - variable (klon, klev) !
    530 !    * NaN value: by definition is variable /= variable
    531 !    * bigvalue: threshold for the variable
    532 
    533   IMPLICIT NONE
    534 
    535 #include "dimensions.h"
    536 
    537   INTEGER, INTENT(IN)                                    :: sizev, zsize
    538   CHARACTER(LEN=50), INTENT(IN)                          :: funcn, varn
    539   REAL, DIMENSION(sizev,zsize), INTENT(IN)               :: var
    540   REAL, INTENT(IN)                                       :: bigvalue
    541   LOGICAL, INTENT(IN)                                    :: stoprun
    542 
    543 ! Local
    544   INTEGER                                                :: i, k, wrongi, xpt, ypt
    545   CHARACTER(LEN=50)                                      :: errmsg
    546   LOGICAL                                                :: found
    547   REAL, DIMENSION(sizev*zsize)                           :: wrongvalues
    548   INTEGER, DIMENSION(sizev*zsize,2)                      :: wronggridpt
    549 
    550 !!!!!!! Variables
    551 ! funcn: at which functino of part of the program variable is checked
    552 ! varn: name of the variable
    553 ! var: variable to check
    554 ! sizev: size of the variable
    555 ! zsize: vertical size of the variable
    556 ! bigvalue: biggest attenaible value for the variable
    557 ! stoprun: Should the run stop if it founds a problem?
    558 
    559   errmsg = 'ERROR -- error -- ERROR -- error'
    560 
    561   found = .FALSE.
    562   wrongi = 0
    563   DO i=1,sizev
    564     DO k=1,zsize
    565       IF (var(i,k) /= var(i,k) .OR. ABS(var(i,k)) > bigvalue ) THEN
    566         IF (wrongi == 0) found = .TRUE.
    567         wrongi = wrongi + 1
    568         wrongvalues(wrongi) = var(i,k)
    569         wronggridpt(wrongi,1) = i
    570         wronggridpt(wrongi,2) = k
    571       END IF
    572     END DO
    573   END DO
    574 
    575   IF (found) THEN
    576     PRINT *,TRIM(errmsg)
    577     PRINT *,"  at '" // TRIM(funcn) // "' variable '" //TRIM(varn)//                 &
    578       "' is wrong in Nvalues= ",wrongi,' at i (x,y) k value___'
    579     DO i=1,wrongi
    580        ypt = INT(wronggridpt(i,1)/wiim) + 1
    581        xpt = wronggridpt(i,1) - (ypt-1)*wiim
    582       PRINT *,wronggridpt(i,1), '(',xpt,', ',ypt,')', wronggridpt(i,2), wrongvalues(i)
    583     END DO
    584     IF (stoprun) THEN
    585       STOP
    586     END IF
    587   END IF
    588 
    589   RETURN
    590 
    591 END SUBROUTINE check_var3D
    592 
Note: See TracChangeset for help on using the changeset viewer.