1 | MODULE etat0_dcmip2_mod |
---|
2 | ! test cases DCMIP 2012, category 2 : Orographic gravity waves |
---|
3 | USE icosa |
---|
4 | IMPLICIT NONE |
---|
5 | PRIVATE |
---|
6 | |
---|
7 | INTEGER, SAVE :: testcase |
---|
8 | INTEGER, PARAMETER :: mountain=0, schaer_noshear=1, schaer_shear=2 |
---|
9 | |
---|
10 | PUBLIC getin_etat0, compute_etat0 |
---|
11 | |
---|
12 | CONTAINS |
---|
13 | |
---|
14 | SUBROUTINE getin_etat0 |
---|
15 | CHARACTER(len=255) :: etat0_type |
---|
16 | etat0_type='jablonowsky06' |
---|
17 | CALL getin("etat0",etat0_type) |
---|
18 | SELECT CASE (TRIM(etat0_type)) |
---|
19 | CASE('dcmip2_mountain') |
---|
20 | testcase = mountain |
---|
21 | CASE('dcmip2_schaer_noshear') |
---|
22 | testcase = schaer_noshear |
---|
23 | CASE('dcmip2_schaer_shear') |
---|
24 | testcase = schaer_shear |
---|
25 | CASE DEFAULT |
---|
26 | PRINT *, 'This should not happen : etat0_type =', TRIM(etat0_type), ' in etat0_dcmip2.f90/etat0' |
---|
27 | STOP |
---|
28 | END SELECT |
---|
29 | PRINT *, 'Orographic gravity-wave test case :', TRIM(etat0_type) |
---|
30 | END SUBROUTINE getin_etat0 |
---|
31 | |
---|
32 | SUBROUTINE compute_etat0(ngrid,lon,lat, phis, ps, Temp, ulon, ulat) |
---|
33 | USE disvert_mod |
---|
34 | USE omp_para |
---|
35 | INTEGER, INTENT(IN) :: ngrid |
---|
36 | REAL(rstd),INTENT(IN) :: lon(ngrid) |
---|
37 | REAL(rstd),INTENT(IN) :: lat(ngrid) |
---|
38 | REAL(rstd),INTENT(OUT) :: ps(ngrid) |
---|
39 | REAL(rstd),INTENT(OUT) :: phis(ngrid) |
---|
40 | REAL(rstd),INTENT(OUT) :: Temp(ngrid,llm) |
---|
41 | REAL(rstd),INTENT(OUT) :: ulon(ngrid,llm) |
---|
42 | REAL(rstd),INTENT(OUT) :: ulat(ngrid,llm) |
---|
43 | INTEGER :: l,ij |
---|
44 | REAL(rstd) :: hyam, hybm |
---|
45 | |
---|
46 | ! Hexagons : ps,phis,temp |
---|
47 | DO l=ll_begin,ll_end |
---|
48 | ! The surface pressure is not set yet so we provide the hybrid coefficients |
---|
49 | hyam = .5*(ap(l)+ap(l+1))/preff |
---|
50 | hybm = .5*(bp(l)+bp(l+1)) |
---|
51 | DO ij=1,ngrid |
---|
52 | CALL comp_all(hyam,hybm,lon(ij),lat(ij), & |
---|
53 | ps(ij),phis(ij), Temp(ij,l),ulon(ij,l), ulat(ij,l) ) |
---|
54 | END DO |
---|
55 | END DO |
---|
56 | END SUBROUTINE compute_etat0 |
---|
57 | |
---|
58 | SUBROUTINE comp_all(hyam,hybm,lon,lat, psj,phisj,tempj, ulonj,ulatj) |
---|
59 | USE dcmip_initial_conditions_test_1_2_3 |
---|
60 | REAL(rstd), INTENT(IN) :: hyam, hybm, lon, lat |
---|
61 | REAL(rstd), INTENT(OUT) :: psj,phisj,tempj,ulonj,ulatj |
---|
62 | REAL :: dummy_p, dummy_z, dummy_w, dummy_rho, dummy_q |
---|
63 | dummy_p=0;dummy_z=0;dummy_w=0;dummy_rho=0;dummy_q=0 |
---|
64 | SELECT CASE (testcase) |
---|
65 | CASE(mountain) |
---|
66 | CALL test2_steady_state_mountain(lon,lat,dummy_p,dummy_z,0,.TRUE.,hyam,hybm, & |
---|
67 | ulonj,ulatj,dummy_w,tempj,phisj,psj,dummy_rho,dummy_q) |
---|
68 | CASE(schaer_noshear) |
---|
69 | CALL test2_schaer_mountain(lon,lat,dummy_p,dummy_z,0,.TRUE.,hyam,hybm,0,& |
---|
70 | ulonj,ulatj,dummy_w,tempj,phisj,psj,dummy_rho,dummy_q) |
---|
71 | CASE(schaer_shear) |
---|
72 | CALL test2_schaer_mountain(lon,lat,dummy_p,dummy_z,0,.TRUE.,hyam,hybm,1, & |
---|
73 | ulonj,ulatj,dummy_w,tempj,phisj,psj,dummy_rho,dummy_q) |
---|
74 | END SELECT |
---|
75 | END SUBROUTINE comp_all |
---|
76 | |
---|
77 | END MODULE etat0_dcmip2_mod |
---|