Changeset 109
- Timestamp:
- 08/07/12 16:57:48 (12 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/dissip_gcm.f90
r98 r109 7 7 TYPE(t_field),POINTER,SAVE :: f_due_diss2(:) 8 8 9 TYPE(t_field),POINTER,SAVE :: f_theta(:) 9 TYPE(t_field),POINTER,SAVE :: f_theta(:), f_phi(:), f_pk(:), f_pks(:), f_p(:) 10 10 TYPE(t_field),POINTER,SAVE :: f_dtheta_diss(:) 11 11 TYPE(t_field),POINTER,SAVE :: f_dtheta_rhodz_diss(:) … … 23 23 REAL,SAVE :: cgradrot 24 24 REAL,SAVE :: cdivgrad 25 26 INTEGER, SAVE :: rayleigh_friction_type, rayleigh_shear 27 REAL, save :: rayleigh_tau 25 28 26 29 INTEGER,SAVE :: idissip … … 38 41 CALL allocate_field(f_dtheta_diss,field_t,type_real,llm) 39 42 CALL allocate_field(f_dtheta_rhodz_diss,field_t,type_real,llm) 43 44 CALL allocate_field(f_phi,field_t,type_real,llm) 45 CALL allocate_field(f_pk,field_t,type_real,llm) 46 CALL allocate_field(f_p,field_t,type_real,llm+1) 47 CALL allocate_field(f_pks,field_t,type_real) 40 48 41 49 ALLOCATE(tau_graddiv(llm)) … … 66 74 REAL(rstd) :: zz, zvert, fact 67 75 INTEGER :: l 76 CHARACTER(len=255) :: rayleigh_friction_key 68 77 69 78 70 79 INTEGER :: i,j,n,ind,it,iter 80 81 rayleigh_friction_key='none' 82 CALL getin("rayleigh_friction_type",rayleigh_friction_key) 83 SELECT CASE(TRIM(rayleigh_friction_key)) 84 CASE('none') 85 rayleigh_friction_type=0 86 PRINT *, 'No Rayleigh friction' 87 CASE('dcmip2_schaer_noshear') 88 rayleigh_friction_type=1 89 rayleigh_shear=0 90 PRINT *, 'Rayleigh friction : Schaer-like mountain without shear DCMIP2.1' 91 CASE('dcmip2_schaer_shear') 92 rayleigh_shear=1 93 rayleigh_friction_type=2 94 PRINT *, 'Rayleigh friction : Schaer-like mountain with shear DCMIP2.2' 95 CASE DEFAULT 96 PRINT *, 'Bad selector : rayleigh_friction_type =', TRIM(rayleigh_friction_key), ' in dissip_gcm.f90/init_dissip' 97 STOP 98 END SELECT 99 100 IF(rayleigh_friction_type>0) THEN 101 rayleigh_tau=0. 102 CALL getin("rayleigh_friction_tau",rayleigh_tau) 103 rayleigh_tau = rayleigh_tau / scale_factor 104 IF(rayleigh_tau<=0) THEN 105 PRINT *, 'Forbidden : negative value for rayleigh_friction_tau =',rayleigh_tau 106 STOP 107 END IF 108 END IF 71 109 72 110 CALL allocate_dissip … … 382 420 383 421 384 SUBROUTINE dissip(f_ue,f_due,f_ps,f_ theta_rhodz,f_dtheta_rhodz)422 SUBROUTINE dissip(f_ue,f_due,f_ps,f_phis,f_theta_rhodz,f_dtheta_rhodz) 385 423 USE icosa 386 424 USE theta2theta_rhodz_mod 425 USE pression_mod 426 USE exner_mod 427 USE geopotential_mod 387 428 IMPLICIT NONE 388 429 TYPE(t_field),POINTER :: f_ue(:) 389 430 TYPE(t_field),POINTER :: f_due(:) 390 TYPE(t_field),POINTER :: f_ps(:) 431 TYPE(t_field),POINTER :: f_ps(:), f_phis(:) 391 432 TYPE(t_field),POINTER :: f_theta_rhodz(:) 392 433 TYPE(t_field),POINTER :: f_dtheta_rhodz(:) 393 434 394 435 REAL(rstd),POINTER :: due(:,:) 436 REAL(rstd),POINTER :: phi(:,:), ue(:,:) 395 437 REAL(rstd),POINTER :: due_diss1(:,:) 396 438 REAL(rstd),POINTER :: due_diss2(:,:) … … 398 440 REAL(rstd),POINTER :: dtheta_rhodz_diss(:,:) 399 441 400 INTEGER :: ind 442 INTEGER :: ind, shear 401 443 INTEGER :: l,i,j,n 402 444 … … 407 449 CALL theta2theta_rhodz(f_ps,f_dtheta_diss,f_dtheta_rhodz_diss) 408 450 451 IF(rayleigh_friction_type>0) THEN 452 CALL pression(f_ps, f_p) 453 CALL exner(f_ps, f_p, f_pks, f_pk) 454 CALL geopotential(f_phis,f_pks,f_pk,f_theta,f_phi) 455 END IF 456 409 457 DO ind=1,ndomain 410 458 CALL swap_dimensions(ind) … … 430 478 ENDDO 431 479 ENDDO 432 ENDDO 480 481 IF(rayleigh_friction_type>0) THEN 482 phi=f_phi(ind) 483 ue=f_ue(ind) 484 DO l=1,llm 485 DO j=jj_begin,jj_end 486 DO i=ii_begin,ii_end 487 n=(j-1)*iim+i 488 CALL relax(t_right, u_right) 489 CALL relax(t_lup, u_lup) 490 CALL relax(t_ldown, u_ldown) 491 ENDDO 492 ENDDO 493 END DO 494 END IF 495 END DO 496 497 CONTAINS 498 SUBROUTINE relax(shift_t, shift_u) 499 USE dcmip_initial_conditions_test_1_2_3 500 REAL(rstd) :: z, ulon,ulat, lon,lat, & ! input to test2_schaer_mountain 501 p,hyam,hybm,w,t,phis,ps,rho,q, & ! unused input/output to test2_schaer_mountain 502 fz, u3d(3), uref 503 REAL(rstd), PARAMETER :: zh=2e4,ztop=3e4 ! DCMIP values 504 LOGICAL :: hybrid_eta 505 INTEGER :: shift_u, shift_t, zcoords, nn 506 z = (phi(n,l)+phi(n+shift_t,l))/(2.*g) 507 IF(z>zh) THEN ! relax only in the sponge layer z>zh 508 ! PRINT *, 'z>zh : z,zh,l',z,zh,l 509 ! STOP 510 nn = n+shift_u 511 CALL xyz2lonlat(xyz_e(nn,:),lon,lat) 512 zcoords = 1 ; hybrid_eta = .FALSE. ! use z instead of p or hyam/hybm 513 CALL test2_schaer_mountain(lon,lat,p,z,zcoords,hybrid_eta, & 514 hyam,hybm,shear,ulon,ulat,w,t,phis,ps,rho,q) 515 ! u3d = ulon*elon_e(nn,:) + ulat*elat_e(nn,:) 516 u3d = ulon*elon_e(nn,:) ! ulat=0 517 uref = sum(u3d*ep_e(nn,:)) 518 519 fz = sin((pi/2)*(z-zh)/(ztop-zh)) 520 fz = fz*fz/rayleigh_tau 521 ! fz = 1/rayleigh_tau 522 due(nn,l) = due(nn,l) - fz*(ue(nn,l)-uref) 523 ! due(nn,l) = due(nn,l) - fz*ue(nn,l) 524 END IF 525 END SUBROUTINE relax 433 526 434 527 END SUBROUTINE dissip -
codes/icosagcm/trunk/src/timeloop_gcm.f90
r99 r109 129 129 130 130 CASE ('adam_bashforth') 131 CALL dissip(f_u,f_du,f_ps,f_ theta_rhodz,f_dtheta_rhodz)131 CALL dissip(f_u,f_du,f_ps,f_phis, f_theta_rhodz,f_dtheta_rhodz) 132 132 CALL adam_bashforth_scheme 133 133
Note: See TracChangeset
for help on using the changeset viewer.