[382] | 1 | MODULE etat0_dcmip2016_baroclinic_wave_mod |
---|
| 2 | USE icosa |
---|
| 3 | IMPLICIT NONE |
---|
[899] | 4 | PRIVATE |
---|
[382] | 5 | |
---|
[408] | 6 | INTEGER :: perturbation |
---|
| 7 | !$OMP THREADPRIVATE(perturbation) |
---|
| 8 | |
---|
[382] | 9 | PUBLIC getin_etat0, compute_etat0 |
---|
| 10 | |
---|
| 11 | CONTAINS |
---|
| 12 | |
---|
| 13 | SUBROUTINE getin_etat0 |
---|
| 14 | USE mpipara, ONLY : is_mpi_root |
---|
[1025] | 15 | USE tracer_icosa_mod |
---|
[408] | 16 | IMPLICIT NONE |
---|
| 17 | CHARACTER(LEN=255) :: str_perturbation |
---|
| 18 | |
---|
[382] | 19 | IF(nqtot<5) THEN |
---|
| 20 | IF (is_mpi_root) THEN |
---|
| 21 | PRINT *, "nqtot must be at least 5 for test case dcmip2016_baroclinic_wave" |
---|
| 22 | END IF |
---|
| 23 | STOP |
---|
| 24 | END IF |
---|
| 25 | |
---|
[408] | 26 | str_perturbation="exponential" |
---|
| 27 | CALL getin("dcmip2016_baroclinic_wave_perturbation",str_perturbation) |
---|
| 28 | IF (TRIM(str_perturbation)=="exponential") THEN |
---|
| 29 | perturbation=0 |
---|
| 30 | ELSE IF (TRIM(str_perturbation)=="stream") THEN |
---|
| 31 | perturbation=1 |
---|
| 32 | ENDIF |
---|
| 33 | |
---|
| 34 | |
---|
[382] | 35 | END SUBROUTINE getin_etat0 |
---|
| 36 | |
---|
| 37 | SUBROUTINE compute_etat0(ngrid,lon,lat, phis,ps,temp,ulon,ulat,q) |
---|
| 38 | USE icosa |
---|
| 39 | USE disvert_mod |
---|
| 40 | USE omp_para |
---|
[408] | 41 | USE dcmip2016_baroclinic_wave_mod, ONLY : baroclinic_wave_test |
---|
| 42 | USE earth_const |
---|
| 43 | USE terminator, ONLY: initial_value_Terminator |
---|
| 44 | IMPLICIT NONE |
---|
[382] | 45 | INTEGER, INTENT(IN) :: ngrid |
---|
| 46 | REAL(rstd),INTENT(IN) :: lon(ngrid) |
---|
| 47 | REAL(rstd),INTENT(IN) :: lat(ngrid) |
---|
| 48 | REAL(rstd),INTENT(OUT) :: phis(ngrid) |
---|
| 49 | REAL(rstd),INTENT(OUT) :: ps(ngrid) |
---|
| 50 | REAL(rstd),INTENT(OUT) :: temp(ngrid,llm) |
---|
| 51 | REAL(rstd),INTENT(OUT) :: ulon(ngrid,llm) |
---|
| 52 | REAL(rstd),INTENT(OUT) :: ulat(ngrid,llm) |
---|
| 53 | REAL(rstd),INTENT(OUT) :: q(ngrid,llm,nqtot) |
---|
| 54 | |
---|
[408] | 55 | INTEGER :: deep=0 |
---|
| 56 | INTEGER :: zcoords |
---|
| 57 | REAL :: p,z |
---|
| 58 | REAL :: rho, thetav |
---|
| 59 | INTEGER :: ij,l |
---|
| 60 | INTEGER :: moist |
---|
[382] | 61 | |
---|
[408] | 62 | moist=0 |
---|
| 63 | IF (physics_thermo==thermo_moist .OR. physics_thermo==thermo_fake_moist) moist=1 |
---|
| 64 | |
---|
[382] | 65 | DO ij=1,ngrid |
---|
[408] | 66 | z=0. |
---|
| 67 | zcoords=1 |
---|
| 68 | CALL baroclinic_wave_test(deep,moist,perturbation,scale_factor,lon(ij),lat(ij),p,z,zcoords,ulon(ij,1),ulat(ij,1), & |
---|
| 69 | temp(ij,1),thetav,phis(ij),ps(ij),rho,q(ij,1,1)) |
---|
[382] | 70 | |
---|
[408] | 71 | zcoords=0 |
---|
| 72 | DO l=ll_begin,ll_end |
---|
| 73 | p=0.5*(ap(l)+ap(l+1) + (bp(l)+bp(l+1)) * ps(ij)) |
---|
| 74 | CALL baroclinic_wave_test(deep,moist,perturbation,scale_factor,lon(ij),lat(ij),p,z,zcoords,ulon(ij,l),ulat(ij,l), & |
---|
| 75 | temp(ij,l),thetav,phis(ij),ps(ij),rho,q(ij,l,1)) |
---|
| 76 | |
---|
| 77 | IF (physics_thermo==thermo_fake_moist) temp(ij,l)=Temp(ij,l)*(1+0.608*q(ij,l,1)) |
---|
| 78 | q(ij,l,2)=0. |
---|
| 79 | q(ij,l,3)=0. |
---|
| 80 | CALL initial_value_Terminator(lat(ij),lon(ij),q(ij,l,4),q(ij,l,5)) |
---|
[382] | 81 | END DO |
---|
[408] | 82 | ENDDO |
---|
| 83 | |
---|
[382] | 84 | END SUBROUTINE compute_etat0 |
---|
[408] | 85 | |
---|
[382] | 86 | END MODULE etat0_dcmip2016_baroclinic_wave_mod |
---|