Changeset 52 in lmdz_wrf
- Timestamp:
- Jul 23, 2014, 5:21:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LMDZ_WRFmeas/WRFV3/lmdz/diagphy_mod.F90
r51 r52 306 306 PRINT *,TRIM(errmsg) 307 307 PRINT *," at '" // TRIM(funcn) // "' variable '" //TRIM(varn)// & 308 "' is wrong at i value___"308 "' is wrong in Nvalues= ",wrongi,' at i value___" 309 309 DO i=1,wrongi 310 310 PRINT *,wronggridpt(i), wrongvalues(i) … … 318 318 319 319 END SUBROUTINE check_var 320 321 SUBROUTINE check_var3D(funcn, varn, var, sizev, zsize, bigvalue, stoprun) 322 ! Subroutine to check the consistency of a 3D LMDSZ - variable (klon, klev) ! 323 ! * NaN value: by definition is variable /= variable 324 ! * bigvalue: threshold for the variable 325 326 IMPLICIT NONE 327 328 INTEGER, INTENT(IN) :: sizev, zsize 329 CHARACTER(LEN=50), INTENT(IN) :: funcn, varn 330 REAL, DIMENSION(sizev), INTENT(IN) :: var 331 REAL, INTENT(IN) :: bigvalue 332 LOGICAL, INTENT(IN) :: stoprun 333 334 ! Local 335 INTEGER :: i, wrongi 336 CHARACTER(LEN=50) :: errmsg 337 LOGICAL :: found 338 REAL, DIMENSION(sizev,zsize) :: wrongvalues 339 INTEGER, DIMENSION(sizev,2) :: wronggridpt 340 341 !!!!!!! Variables 342 ! funcn: at which functino of part of the program variable is checked 343 ! varn: name of the variable 344 ! var: variable to check 345 ! sizev: size of the variable 346 ! zsize: vertical size of the variable 347 ! bigvalue: biggest attenaible value for the variable 348 ! stoprun: Should the run stop if it founds a problem? 349 350 errmsg = 'ERROR -- error -- ERROR -- error' 351 352 found = .FALSE. 353 wrongi = 0 354 DO i=1,sizev 355 DO k=1,zsize 356 IF (var(i,k) /= var(i,k) .OR. ABS(var(i,k)) > bigvalue ) THEN 357 IF (wrongi == 0) found = .TRUE. 358 wrongi = wrongi + 1 359 wrongvalues(wrongi) = var(i,k) 360 wronggridpt(wrongi,1) = i 361 wronggridpt(wrongi,2) = k 362 END IF 363 END DO 364 END DO 365 366 IF (found) THEN 367 PRINT *,TRIM(errmsg) 368 PRINT *," at '" // TRIM(funcn) // "' variable '" //TRIM(varn)// & 369 "' is wrong in Nvalues= ",wrongi,' at i k value___" 370 DO i=1,wrongi 371 PRINT *,wronggridpt(i,:), wrongvalues(i) 372 END DO 373 IF (stoprun) THEN 374 STOP 375 END IF 376 END IF 377 378 RETURN 379 380 END SUBROUTINE check_var3D 381 320 382 321 383 !C====================================================================== … … 611 673 varname = 'zh_dair_col' 612 674 CALL check_var(fname, varname, zh_dair_col, klon, largest*10.e6, .FALSE.) 675 PRINT *,' zh_dair_col = func(q,ql,qs,paprs)' 676 varname = 'q' 677 CALL check_var3D(fname, varname, q, klon, klev, largest, .FALSE.) 678 varname = 'ql' 679 CALL check_var3D(fname, varname, ql, klon, klev, largest, .FALSE.) 680 varname = 'qs' 681 CALL check_var3D(fname, varname, qs, klon, klev, largest, .FALSE.) 682 varname = 'paprs' 683 CALL check_var3D(fname, varname, paprs, klon, klev, largest*10.e6, .FALSE.) 613 684 END IF 614 685 PRINT *,' h_qw_tot= ',h_qw_tot … … 631 702 END IF 632 703 704 IF (qs_tot .NE. qs_tot .OR. ABS(qs_tot) > largest) THEN 705 PRINT *,TRIM(errmsg) 706 PRINT *,' ' // TRIM(fname) // ': Wrong qs_tot= ',qs_tot,' !!!' 707 PRINT *,' qs: total mass of solid watter (kg/m2)' 708 PRINT *,' qs = zqs_col(i)*airephy(i)' 709 varname = 'airephy' 710 CALL check_var(fname, varname, airephy, klon, largest*10.e5, .FALSE.) 711 varname = 'zqs_col' 712 CALL check_var(fname, varname, zqs_col, klon, largest*10.e5, .FALSE.) 713 STOP 714 END IF 633 715 RETURN 634 716 END SUBROUTINE diagetpq
Note: See TracChangeset
for help on using the changeset viewer.