Ignore:
Timestamp:
01/19/17 01:58:59 (7 years ago)
Author:
dubos
Message:

Fixed Rayleigh friction (DCMIP 2.1)

Location:
codes/icosagcm/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/trunk/src/dissip_gcm.f90

    r487 r523  
    77  TYPE(t_field),POINTER,SAVE :: f_due_diss2(:) 
    88 
    9   TYPE(t_field),POINTER,SAVE :: f_theta(:), f_phi(:), f_pk(:), f_pks(:), f_p(:) 
    109  TYPE(t_field),POINTER,SAVE :: f_dtheta_diss(:) 
    1110  TYPE(t_field),POINTER,SAVE :: f_dtheta_rhodz_diss(:) 
     
    4948    CALL allocate_field(f_due_diss1,field_u,type_real,llm) 
    5049    CALL allocate_field(f_due_diss2,field_u,type_real,llm) 
    51     CALL allocate_field(f_theta,field_t,type_real,llm) 
    5250    CALL allocate_field(f_dtheta_diss,field_t,type_real,llm) 
    5351    CALL allocate_field(f_dtheta_rhodz_diss,field_t,type_real,llm) 
    54  
    55     CALL allocate_field(f_phi,field_t,type_real,llm) 
    56     CALL allocate_field(f_pk,field_t,type_real,llm) 
    57     CALL allocate_field(f_p,field_t,type_real,llm+1) 
    58     CALL allocate_field(f_pks,field_t,type_real) 
    59      
    6052    ALLOCATE(tau_graddiv(llm)) 
    6153    ALLOCATE(tau_gradrot(llm))     
     
    435427      mintau=MIN(mintau,tau_divgrad(l)) 
    436428    ENDDO 
    437         
     429 
     430    IF(rayleigh_friction_type>0) mintau=MIN(mintau,rayleigh_tau) 
     431 
    438432    IF(mintau>0) THEN 
    439433       itau_dissip=INT(mintau/dt) 
     
    444438    END IF 
    445439    itau_dissip=MAX(1,itau_dissip) 
    446     IF (is_master) PRINT *,"mintau ",mintau,"itau_dissip",itau_dissip," dtdissip ",dtdissip 
     440    IF (is_master) PRINT *,"rayleigh_tau",rayleigh_tau, "mintau ",mintau, & 
     441         "itau_dissip",itau_dissip," dtdissip ",dtdissip 
    447442 
    448443  END SUBROUTINE init_dissip  
    449444  
    450445   
    451   SUBROUTINE dissip(f_ue,f_due,f_mass,f_phis,f_theta_rhodz,f_dtheta_rhodz) 
     446  SUBROUTINE dissip(f_ps,f_mass,f_phis,f_geopot,f_theta_rhodz,f_ue, f_dtheta_rhodz,f_due) 
    452447  USE icosa 
    453448  USE theta2theta_rhodz_mod 
     
    459454  USE omp_para 
    460455  IMPLICIT NONE 
    461     TYPE(t_field),POINTER :: f_ue(:) 
    462     TYPE(t_field),POINTER :: f_due(:) 
    463     TYPE(t_field),POINTER :: f_mass(:), f_phis(:) 
    464     TYPE(t_field),POINTER :: f_theta_rhodz(:) 
    465     TYPE(t_field),POINTER :: f_dtheta_rhodz(:) 
     456    TYPE(t_field),POINTER :: f_ps(:), f_mass(:), f_phis(:), f_geopot(:) 
     457    TYPE(t_field),POINTER :: f_theta_rhodz(:), f_dtheta_rhodz(:) 
     458    TYPE(t_field),POINTER :: f_ue(:), f_due(:) 
    466459 
    467460    REAL(rstd),POINTER         :: due(:,:) 
     
    483476    CALL divgrad_theta_rhodz(f_mass,f_theta_rhodz,f_dtheta_rhodz_diss) 
    484477     
    485 ! later for openmp     
    486 !    IF(rayleigh_friction_type>0) THEN 
    487 !       CALL pression(f_ps, f_p) 
    488 !       CALL exner(f_ps, f_p, f_pks, f_pk) 
    489 !       CALL geopotential(f_phis,f_pks,f_pk,f_theta,f_phi) 
    490 !    END IF 
    491  
    492478    DO ind=1,ndomain 
    493479      IF (.NOT. assigned_domain(ind)) CYCLE 
     
    515501!      due=0 
    516502 
    517 ! later for openmp   
    518 !      IF(rayleigh_friction_type>0) THEN 
    519 !         phi=f_phi(ind) 
    520 !         ue=f_ue(ind) 
    521 !         DO l=1,llm 
    522 !            DO j=jj_begin,jj_end 
    523 !               DO i=ii_begin,ii_end 
    524 !                  n=(j-1)*iim+i 
    525 !                  CALL relax(t_right, u_right) 
    526 !                  CALL relax(t_lup,   u_lup) 
    527 !                  CALL relax(t_ldown, u_ldown) 
    528 !               ENDDO 
    529 !            ENDDO 
    530 !         END DO 
    531 !      END IF 
     503      IF(rayleigh_friction_type>0) THEN 
     504         phi=f_geopot(ind) 
     505         ue=f_ue(ind) 
     506         DO l=1,llm 
     507            DO ij=ij_begin,ij_end 
     508               CALL relax(t_right, u_right) 
     509               CALL relax(t_lup,   u_lup) 
     510               CALL relax(t_ldown, u_ldown) 
     511            ENDDO 
     512         END DO 
     513      END IF 
    532514   END DO 
    533515 
     
    558540           fz = sin((pi/2)*(z-zh)/(ztop-zh)) 
    559541           fz = fz*fz/rayleigh_tau 
    560 !           fz = 1/rayleigh_tau 
    561            due(nn,l) = due(nn,l) - fz*(ue(nn,l)-uref) 
     542           due(nn,l) = due(nn,l) - itau_dissip*fz*(ue(nn,l)-uref) 
     543!           fz = 1./rayleigh_tau 
    562544!           due(nn,l) = due(nn,l) - fz*ue(nn,l) 
    563545         END IF 
  • codes/icosagcm/trunk/src/timeloop_gcm.f90

    r519 r523  
    284284               f_ps,f_dps,f_u,f_theta_rhodz,f_phis) 
    285285        
    286           CALL dissip(f_u,f_du,f_mass,f_phis, f_theta_rhodz,f_dtheta_rhodz) 
     286          CALL dissip(f_ps,f_mass,f_phis,f_geopot,f_theta_rhodz,f_u, f_dtheta_rhodz,f_du) 
    287287           
    288288          CALL euler_scheme(.FALSE.)  ! update only u, theta 
Note: See TracChangeset for help on using the changeset viewer.