Changeset 62 in lmdz_wrf for branches/LMDZ_WRFmeas
- Timestamp:
- Jul 24, 2014, 11:37:02 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LMDZ_WRFmeas/WRFV3/lmdz/physiq.F90
r49 r62 1301 1301 ! Lluis 1302 1302 INTEGER :: llp 1303 CHARACTER(LEN=50) :: lvarname, lfunc 1304 REAL :: largest 1305 1303 1306 llp = 734 1307 lfunc = 'physiq' 1308 largest = 10.e5 1304 1309 1305 1310 !c====================================================================== … … 2951 2956 2952 2957 endif 2958 lvarname = 't_seri' 2959 fname='after thermals' 2960 CALL check_var3D(fname, varname, t_seri, klon, klev, largest, .FALSE.) 2961 lvarname = 'q_seri' 2962 CALL check_var3D(fname, varname, q_seri, klon, klev, largest, .FALSE.) 2963 lvarname = 'd_t_ajsb' 2964 CALL check_var3D(fname, varname, d_t_ajsb, klon, klev, largest, .FALSE.) 2965 lvarname = 'd_q_ajsb' 2966 CALL check_var3D(fname, varname, d_q_ajsb, klon, klev, largest, .FALSE.) 2967 2953 2968 !c 2954 2969 !c=================================================================== … … 3039 3054 call writefield_phy('q_seri',q_seri,llm) 3040 3055 endif 3041 3042 3056 !c 3043 3057 !c------------------------------------------------------------------- … … 4350 4364 RETURN 4351 4365 END SUBROUTINE gr_fi_ecrit 4366 4367 SUBROUTINE check_var3D(funcn, varn, var, sizev, zsize, bigvalue, stoprun) 4368 ! Subroutine to check the consistency of a 3D LMDSZ - variable (klon, klev) ! 4369 ! * NaN value: by definition is variable /= variable 4370 ! * bigvalue: threshold for the variable 4371 4372 IMPLICIT NONE 4373 4374 #include "dimensions.h" 4375 4376 INTEGER, INTENT(IN) :: sizev, zsize 4377 CHARACTER(LEN=50), INTENT(IN) :: funcn, varn 4378 REAL, DIMENSION(sizev,zsize), INTENT(IN) :: var 4379 REAL, INTENT(IN) :: bigvalue 4380 LOGICAL, INTENT(IN) :: stoprun 4381 4382 ! Local 4383 INTEGER :: i, k, wrongi, xpt, ypt 4384 CHARACTER(LEN=50) :: errmsg 4385 LOGICAL :: found 4386 REAL, DIMENSION(sizev*zsize) :: wrongvalues 4387 INTEGER, DIMENSION(sizev,2) :: wronggridpt 4388 4389 !!!!!!! Variables 4390 ! funcn: at which functino of part of the program variable is checked 4391 ! varn: name of the variable 4392 ! var: variable to check 4393 ! sizev: size of the variable 4394 ! zsize: vertical size of the variable 4395 ! bigvalue: biggest attenaible value for the variable 4396 ! stoprun: Should the run stop if it founds a problem? 4397 4398 errmsg = 'ERROR -- error -- ERROR -- error' 4399 4400 found = .FALSE. 4401 wrongi = 0 4402 DO i=1,sizev 4403 DO k=1,zsize 4404 IF (var(i,k) /= var(i,k) .OR. ABS(var(i,k)) > bigvalue ) THEN 4405 IF (wrongi == 0) found = .TRUE. 4406 wrongi = wrongi + 1 4407 wrongvalues(wrongi) = var(i,k) 4408 wronggridpt(wrongi,1) = i 4409 wronggridpt(wrongi,2) = k 4410 END IF 4411 END DO 4412 END DO 4413 4414 IF (found) THEN 4415 PRINT *,TRIM(errmsg) 4416 PRINT *," at '" // TRIM(funcn) // "' variable '" //TRIM(varn)// & 4417 "' is wrong in Nvalues= ",wrongi,' at i (x,y) k value___' 4418 DO i=1,wrongi 4419 ypt = INT(wronggridpt(i,1)/wiim) + 1 4420 xpt = wronggridpt(i,1) - (ypt-1)*wiim 4421 PRINT *,wronggridpt(i,1), '(',xpt,', ',ypt,')', wronggridpt(i,2), wrongvalues(i) 4422 END DO 4423 IF (stoprun) THEN 4424 STOP 4425 END IF 4426 END IF 4427 4428 RETURN 4429 4430 END SUBROUTINE check_var3D 4431
Note: See TracChangeset
for help on using the changeset viewer.