Changeset 408


Ignore:
Timestamp:
06/09/16 02:15:40 (8 years ago)
Author:
ymipsl
Message:

Modif of dcmip16 baroclinic wave etat0

YM

File:
1 edited

Legend:

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

    r388 r408  
    33  IMPLICIT NONE 
    44  PRIVATE 
    5    
    6   REAL(rstd),PARAMETER :: eta0=0.252 
    7   REAL(rstd),PARAMETER :: etat=0.2 
    8   REAL(rstd),PARAMETER :: ps0=1e5 
    9   REAL(rstd),PARAMETER :: u0=35 
    10   REAL(rstd),PARAMETER :: T0=288 
    11   REAL(rstd),PARAMETER :: DeltaT=4.8e5 
    12   REAL(rstd),PARAMETER :: Rd=287 
    13   REAL(rstd),PARAMETER :: Gamma=0.005 
    14   REAL(rstd),PARAMETER :: up0=1 
    15   REAL(rstd),PARAMETER :: lonc=Pi/9, latc=2*Pi/9, latw=2*Pi/9 
    16   REAL(rstd),PARAMETER :: pw=34000 
    17   REAL(rstd),PARAMETER :: q0=0.021 
    18    
     5  
    196  INTEGER,SAVE :: testcase 
    207  !$OMP THREADPRIVATE(testcase)   
    218   
     9  INTEGER :: perturbation 
     10  !$OMP THREADPRIVATE(perturbation)   
     11 
    2212  PUBLIC getin_etat0, compute_etat0 
    2313 
     
    2717    USE mpipara, ONLY : is_mpi_root 
    2818    USE tracer_mod 
     19    IMPLICIT NONE 
     20    LOGICAL :: is_moist 
     21    CHARACTER(LEN=255) :: str_perturbation 
     22     
    2923    IF(nqtot<5) THEN 
    3024       IF (is_mpi_root)  THEN 
     
    3327       STOP 
    3428    END IF 
    35 !    CALL set_advection_scheme(1,advect_none) 
    36 !    CALL set_advection_scheme(2,advect_none) 
    37 !    CALL set_advection_scheme(3,advect_none) 
    3829     
     30    str_perturbation="exponential" 
     31    CALL getin("dcmip2016_baroclinic_wave_perturbation",str_perturbation) 
     32    IF (TRIM(str_perturbation)=="exponential") THEN 
     33      perturbation=0 
     34    ELSE IF (TRIM(str_perturbation)=="stream") THEN 
     35      perturbation=1 
     36    ENDIF 
     37     
     38   
    3939  END SUBROUTINE getin_etat0 
    4040 
     
    4343    USE disvert_mod 
    4444    USE omp_para 
    45     USE terminator 
    46     USE tracer_mod 
     45    USE dcmip2016_baroclinic_wave_mod, ONLY : baroclinic_wave_test 
     46    USE earth_const 
     47    USE terminator, ONLY: initial_value_Terminator 
     48    IMPLICIT NONE 
    4749    INTEGER, INTENT(IN) :: ngrid 
    4850    REAL(rstd),INTENT(IN) :: lon(ngrid) 
     
    5557    REAL(rstd),INTENT(OUT) :: q(ngrid,llm,nqtot) 
    5658     
    57     INTEGER :: l,ij 
    58     REAL(rstd) :: etal, etavl, etas, etavs, sinlat, coslat, & 
    59          Y, Tave, T, phis_ave, vort, r2, utot, & 
    60          dthetaodeta_ave, dthetaodeta, dthetaodlat, duodeta, K, r 
     59    INTEGER :: deep=0 
     60    INTEGER :: zcoords 
     61    REAL :: p,z 
     62    REAL :: rho, thetav 
     63    INTEGER :: ij,l 
     64    INTEGER :: moist 
    6165     
    62     etas=ap(1)/preff+bp(1) 
    63     etavs=(etas-eta0)*Pi/2 
    64     phis_ave=T0*g/Gamma*(1-etas**(Rd*Gamma/g)) 
    65      
     66    moist=0 
     67    IF (physics_thermo==thermo_moist .OR. physics_thermo==thermo_fake_moist) moist=1 
     68    
    6669    DO ij=1,ngrid 
    67        sinlat=SIN(lat(ij)) 
    68        coslat=COS(lat(ij)) 
    69        phis(ij)=phis_ave+u0*cos(etavs)**1.5*( (-2*sinlat**6 * (coslat**2+1./3) + 10./63 )*u0*cos(etavs)**1.5  & 
    70             +(8./5*coslat**3 * (sinlat**2 + 2./3) - Pi/4)*radius*Omega ) 
    71        ps(ij)=ps0 
     70       z=0. 
     71       zcoords=1 
     72       CALL baroclinic_wave_test(deep,moist,perturbation,scale_factor,lon(ij),lat(ij),p,z,zcoords,ulon(ij,1),ulat(ij,1), & 
     73                                 temp(ij,1),thetav,phis(ij),ps(ij),rho,q(ij,1,1)) 
     74        
     75       zcoords=0 
     76       DO l=ll_begin,ll_end 
     77         p=0.5*(ap(l)+ap(l+1) + (bp(l)+bp(l+1)) * ps(ij)) 
     78         CALL baroclinic_wave_test(deep,moist,perturbation,scale_factor,lon(ij),lat(ij),p,z,zcoords,ulon(ij,l),ulat(ij,l), & 
     79                                   temp(ij,l),thetav,phis(ij),ps(ij),rho,q(ij,l,1)) 
     80                                    
     81        IF (physics_thermo==thermo_fake_moist) temp(ij,l)=Temp(ij,l)*(1+0.608*q(ij,l,1)) 
     82        q(ij,l,2)=0. 
     83        q(ij,l,3)=0. 
     84        CALL initial_value_Terminator(lat(ij),lon(ij),q(ij,l,4),q(ij,l,5)) 
     85       END DO 
    7286    ENDDO 
    73      
    74     DO l=ll_begin,ll_end 
    75        etal = 0.5 *( ap(l)/preff+bp(l) + ap(l+1)/preff+bp(l+1) ) 
    76        etavl=(etal-eta0)*Pi/2 
    77         
    78        Tave=T0*etal**(Rd*Gamma/g) 
    79        dthetaodeta_ave = T0 *( Rd*Gamma/g - kappa)* etal**(Rd*Gamma/g-kappa-1) 
    80        IF (etat>etal) THEN 
    81           Tave=Tave+DeltaT*(etat-etal)**5 
    82           dthetaodeta_ave = dthetaodeta_ave - DeltaT * ( 5*(etat-etal)**4 * etal**(-kappa)  & 
    83                + kappa * (etat-etal)**5 * etal**(-kappa-1)) 
    84        END IF 
    85         
    86        DO ij=1,ngrid 
    87           sinlat=SIN(lat(ij)) 
    88           coslat=COS(lat(ij)) 
    89            
    90           K=sin(latc)*sinlat+cos(latc)*coslat*cos(lon(ij)-lonc) 
    91           r=radius*acos(K) 
    92           utot=u0*cos(etavl)**1.5*sin(2*lat(ij))**2 + up0*exp(-(r/(0.1*radius))**2) 
    93           ulon(ij,l) = utot 
    94           ulat(ij,l) = 0. 
    95           Y = ((-2*sinlat**6*(coslat**2+1./3)+10./63)*2*u0*cos(etavl)**1.5     & 
    96                + (8./5*coslat**3*(sinlat**2+2./3)-Pi/4)*radius*Omega) 
    97           T = Tave + 0.75*(etal*Pi*u0/Rd)*sin(etavl)*cos(etavl)**0.5 * Y 
    98           temp(ij,l)=T 
    99            
    100           q(ij,l,1)=q0*exp(-(lat(ij)/latw)**4)*exp(-((etal-1)*preff/pw)**2) 
    101           q(ij,l,2)=0. 
    102           q(ij,l,3)=0. 
    103           CALL initial_value_Terminator(lat(ij),lon(ij),q(ij,l,4),q(ij,l,5)) 
    104        END DO 
    105     END DO 
    106      
     87 
    10788  END SUBROUTINE compute_etat0 
    108    
     89 
    10990END MODULE etat0_dcmip2016_baroclinic_wave_mod 
Note: See TracChangeset for help on using the changeset viewer.