Changeset 138 in lmdz_wrf
- Timestamp:
- Jul 29, 2014, 11:36:55 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LMDZ_WRFmeas/WRFV3/lmdz/physiq.F90
r89 r138 1299 1299 integer iostat 1300 1300 1301 ! Lluis1302 INTEGER :: llp1303 CHARACTER(LEN=50) :: lvarname, lfname1304 REAL :: largest1305 1306 llp = 7341307 lfname = 'physiq'1308 largest = 10.e51309 1310 1301 !c====================================================================== 1311 1302 ! Gestion calendrier : mise a jour du module phys_cal_mod 1312 1303 ! 1313 1304 CALL phys_cal_update(jD_cur,jH_cur) 1314 PRINT *,' Lluis physiq: jD_cur: ',jD_cur, ' jH_cur: ',jH_cur, &1315 ' days_elapsed: ',days_elapsed1316 1305 1317 1306 !c====================================================================== … … 2769 2758 !c detr_therm(:,:)=0. 2770 2759 !c 2771 lfname='physiq before thermals'2772 lvarname = 't_seri'2773 CALL check_var3D(lfname, lvarname, t_seri, klon, klev, largest, .FALSE.)2774 lvarname = 'q_seri'2775 CALL check_var3D(lfname, lvarname, q_seri, klon, klev, largest, .FALSE.)2776 lvarname = 'd_t_ajs'2777 CALL check_var3D(lfname, lvarname, d_t_ajs, klon, klev, largest, .FALSE.)2778 lvarname = 'd_q_ajs'2779 CALL check_var3D(lfname, lvarname, d_q_ajs, klon, klev, largest, .FALSE.)2780 2760 2781 2761 IF(prt_level>9)WRITE(lunout,*) & … … 2828 2808 & ,zqla,ztva ) 2829 2809 2830 lfname='physiq just after thermals'2831 lvarname = 't_seri'2832 CALL check_var3D(lfname, lvarname, t_seri, klon, klev, largest, .FALSE.)2833 lvarname = 'q_seri'2834 CALL check_var3D(lfname, lvarname, q_seri, klon, klev, largest, .FALSE.)2835 lvarname = 'd_t_ajs'2836 CALL check_var3D(lfname, lvarname, d_t_ajs, klon, klev, largest, .FALSE.)2837 lvarname = 'd_q_ajs'2838 CALL check_var3D(lfname, lvarname, d_q_ajs, klon, klev, largest, .FALSE.)2839 2840 2810 !ccc nrlmd le 10/04/2012 2841 2811 !c-----------Stochastic triggering----------- … … 2976 2946 2977 2947 endif 2978 lfname='after thermals'2979 lvarname = 't_seri'2980 CALL check_var3D(lfname, lvarname, t_seri, klon, klev, largest, .FALSE.)2981 lvarname = 'q_seri'2982 CALL check_var3D(lfname, lvarname, q_seri, klon, klev, largest, .FALSE.)2983 lvarname = 'd_t_ajsb'2984 CALL check_var3D(lfname, lvarname, d_t_ajsb, klon, klev, largest, .FALSE.)2985 lvarname = 'd_q_ajsb'2986 CALL check_var3D(lfname, lvarname, d_q_ajsb, klon, klev, largest, .FALSE.)2987 2948 2988 2949 !c … … 4384 4345 RETURN 4385 4346 END SUBROUTINE gr_fi_ecrit 4386 4387 SUBROUTINE check_var(funcn, varn, var, sizev, bigvalue, stoprun)4388 ! Subroutine to check the consistency of a variable4389 ! * NaN value: by definition is variable /= variable4390 ! * bigvalue: threshold for the variable4391 4392 IMPLICIT NONE4393 4394 #include "dimensions.h"4395 4396 INTEGER, INTENT(IN) :: sizev4397 CHARACTER(LEN=50), INTENT(IN) :: funcn, varn4398 REAL, DIMENSION(sizev), INTENT(IN) :: var4399 REAL, INTENT(IN) :: bigvalue4400 LOGICAL, INTENT(IN) :: stoprun4401 4402 ! Local4403 INTEGER :: i, wrongi, xpt, ypt4404 CHARACTER(LEN=50) :: errmsg4405 LOGICAL :: found4406 REAL, DIMENSION(sizev) :: wrongvalues4407 INTEGER, DIMENSION(sizev) :: wronggridpt4408 4409 !!!!!!! Variables4410 ! funcn: at which functino of part of the program variable is checked4411 ! varn: name of the variable4412 ! var: variable to check4413 ! sizev: size of the variable4414 ! bigvalue: biggest attenaible value for the variable4415 ! stoprun: Should the run stop if it founds a problem?4416 4417 errmsg = 'ERROR -- error -- ERROR -- error'4418 4419 found = .FALSE.4420 wrongi = 04421 DO i=1,sizev4422 IF (var(i) /= var(i) .OR. ABS(var(i)) > bigvalue ) THEN4423 IF (wrongi == 0) found = .TRUE.4424 wrongi = wrongi + 14425 wrongvalues(wrongi) = var(i)4426 wronggridpt(wrongi) = i4427 END IF4428 END DO4429 4430 IF (found) THEN4431 PRINT *,TRIM(errmsg)4432 PRINT *," at '" // TRIM(funcn) // "' variable '" //TRIM(varn)// &4433 "' is wrong in Nvalues= ",wrongi,' at i (x, y) value___', bigvalue4434 DO i=1,wrongi4435 ypt = INT(wronggridpt(i)/wiim) + 14436 xpt = wronggridpt(i) - (ypt-1)*wiim4437 PRINT *,wronggridpt(i), '(',xpt,', ',ypt,')', wrongvalues(i)4438 END DO4439 IF (stoprun) THEN4440 STOP4441 END IF4442 END IF4443 4444 RETURN4445 4446 END SUBROUTINE check_var4447 4448 SUBROUTINE check_var3D(funcn, varn, var, sizev, zsize, bigvalue, stoprun)4449 ! Subroutine to check the consistency of a 3D LMDSZ - variable (klon, klev) !4450 ! * NaN value: by definition is variable /= variable4451 ! * bigvalue: threshold for the variable4452 4453 IMPLICIT NONE4454 4455 #include "dimensions.h"4456 4457 INTEGER, INTENT(IN) :: sizev, zsize4458 CHARACTER(LEN=50), INTENT(IN) :: funcn, varn4459 REAL, DIMENSION(sizev,zsize), INTENT(IN) :: var4460 REAL, INTENT(IN) :: bigvalue4461 LOGICAL, INTENT(IN) :: stoprun4462 4463 ! Local4464 INTEGER :: i, k, wrongi, xpt, ypt4465 CHARACTER(LEN=50) :: errmsg4466 LOGICAL :: found4467 REAL, DIMENSION(sizev*zsize) :: wrongvalues4468 INTEGER, DIMENSION(sizev*zsize,2) :: wronggridpt4469 4470 !!!!!!! Variables4471 ! funcn: at which functino of part of the program variable is checked4472 ! varn: name of the variable4473 ! var: variable to check4474 ! sizev: size of the variable4475 ! zsize: vertical size of the variable4476 ! bigvalue: biggest attenaible value for the variable4477 ! stoprun: Should the run stop if it founds a problem?4478 4479 errmsg = 'ERROR -- error -- ERROR -- error'4480 4481 found = .FALSE.4482 wrongi = 04483 DO i=1,sizev4484 DO k=1,zsize4485 IF (var(i,k) /= var(i,k) .OR. ABS(var(i,k)) > bigvalue ) THEN4486 IF (wrongi == 0) found = .TRUE.4487 wrongi = wrongi + 14488 wrongvalues(wrongi) = var(i,k)4489 wronggridpt(wrongi,1) = i4490 wronggridpt(wrongi,2) = k4491 END IF4492 END DO4493 END DO4494 4495 IF (found) THEN4496 PRINT *,TRIM(errmsg)4497 PRINT *," at '" // TRIM(funcn) // "' variable '" //TRIM(varn)// &4498 "' is wrong in Nvalues= ",wrongi,' at i (x,y) k value___'4499 DO i=1,wrongi4500 ypt = INT(wronggridpt(i,1)/wiim) + 14501 xpt = wronggridpt(i,1) - (ypt-1)*wiim4502 PRINT *,wronggridpt(i,1), '(',xpt,', ',ypt,')', wronggridpt(i,2), wrongvalues(i)4503 END DO4504 IF (stoprun) THEN4505 STOP4506 END IF4507 END IF4508 4509 RETURN4510 4511 END SUBROUTINE check_var3D4512
Note: See TracChangeset
for help on using the changeset viewer.