[382] | 1 | MODULE etat0_dcmip2016_baroclinic_wave_mod |
---|
| 2 | USE icosa |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | PRIVATE |
---|
[408] | 5 | |
---|
[382] | 6 | INTEGER,SAVE :: testcase |
---|
| 7 | !$OMP THREADPRIVATE(testcase) |
---|
| 8 | |
---|
[408] | 9 | INTEGER :: perturbation |
---|
| 10 | !$OMP THREADPRIVATE(perturbation) |
---|
| 11 | |
---|
[382] | 12 | PUBLIC getin_etat0, compute_etat0 |
---|
| 13 | |
---|
| 14 | CONTAINS |
---|
| 15 | |
---|
| 16 | SUBROUTINE getin_etat0 |
---|
| 17 | USE mpipara, ONLY : is_mpi_root |
---|
| 18 | USE tracer_mod |
---|
[408] | 19 | IMPLICIT NONE |
---|
| 20 | LOGICAL :: is_moist |
---|
| 21 | CHARACTER(LEN=255) :: str_perturbation |
---|
| 22 | |
---|
[382] | 23 | IF(nqtot<5) THEN |
---|
| 24 | IF (is_mpi_root) THEN |
---|
| 25 | PRINT *, "nqtot must be at least 5 for test case dcmip2016_baroclinic_wave" |
---|
| 26 | END IF |
---|
| 27 | STOP |
---|
| 28 | END IF |
---|
| 29 | |
---|
[408] | 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 | |
---|
[382] | 39 | END SUBROUTINE getin_etat0 |
---|
| 40 | |
---|
| 41 | SUBROUTINE compute_etat0(ngrid,lon,lat, phis,ps,temp,ulon,ulat,q) |
---|
| 42 | USE icosa |
---|
| 43 | USE disvert_mod |
---|
| 44 | USE omp_para |
---|
[408] | 45 | USE dcmip2016_baroclinic_wave_mod, ONLY : baroclinic_wave_test |
---|
| 46 | USE earth_const |
---|
| 47 | USE terminator, ONLY: initial_value_Terminator |
---|
| 48 | IMPLICIT NONE |
---|
[382] | 49 | INTEGER, INTENT(IN) :: ngrid |
---|
| 50 | REAL(rstd),INTENT(IN) :: lon(ngrid) |
---|
| 51 | REAL(rstd),INTENT(IN) :: lat(ngrid) |
---|
| 52 | REAL(rstd),INTENT(OUT) :: phis(ngrid) |
---|
| 53 | REAL(rstd),INTENT(OUT) :: ps(ngrid) |
---|
| 54 | REAL(rstd),INTENT(OUT) :: temp(ngrid,llm) |
---|
| 55 | REAL(rstd),INTENT(OUT) :: ulon(ngrid,llm) |
---|
| 56 | REAL(rstd),INTENT(OUT) :: ulat(ngrid,llm) |
---|
| 57 | REAL(rstd),INTENT(OUT) :: q(ngrid,llm,nqtot) |
---|
| 58 | |
---|
[408] | 59 | INTEGER :: deep=0 |
---|
| 60 | INTEGER :: zcoords |
---|
| 61 | REAL :: p,z |
---|
| 62 | REAL :: rho, thetav |
---|
| 63 | INTEGER :: ij,l |
---|
| 64 | INTEGER :: moist |
---|
[382] | 65 | |
---|
[408] | 66 | moist=0 |
---|
| 67 | IF (physics_thermo==thermo_moist .OR. physics_thermo==thermo_fake_moist) moist=1 |
---|
| 68 | |
---|
[382] | 69 | DO ij=1,ngrid |
---|
[408] | 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)) |
---|
[382] | 74 | |
---|
[408] | 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)) |
---|
[382] | 85 | END DO |
---|
[408] | 86 | ENDDO |
---|
| 87 | |
---|
[382] | 88 | END SUBROUTINE compute_etat0 |
---|
[408] | 89 | |
---|
[382] | 90 | END MODULE etat0_dcmip2016_baroclinic_wave_mod |
---|