[12] | 1 | MODULE etat0_mod |
---|
[149] | 2 | CHARACTER(len=255),SAVE :: etat0_type |
---|
[186] | 3 | !$OMP THREADPRIVATE(etat0_type) |
---|
[12] | 4 | |
---|
[17] | 5 | CONTAINS |
---|
| 6 | |
---|
[159] | 7 | SUBROUTINE etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[54] | 8 | USE icosa |
---|
[192] | 9 | USE mpipara, ONLY : is_mpi_root |
---|
[159] | 10 | USE disvert_mod |
---|
[164] | 11 | USE etat0_williamson_mod, ONLY : etat0_williamson_new |
---|
[54] | 12 | USE etat0_jablonowsky06_mod, ONLY : etat0_jablonowsky06=>etat0 |
---|
| 13 | USE etat0_academic_mod, ONLY : etat0_academic=>etat0 |
---|
| 14 | USE etat0_dcmip1_mod, ONLY : etat0_dcmip1=>etat0 |
---|
| 15 | USE etat0_dcmip2_mod, ONLY : etat0_dcmip2=>etat0 |
---|
| 16 | USE etat0_dcmip3_mod, ONLY : etat0_dcmip3=>etat0 |
---|
[78] | 17 | USE etat0_dcmip4_mod, ONLY : etat0_dcmip4=>etat0 |
---|
[113] | 18 | USE etat0_dcmip5_mod, ONLY : etat0_dcmip5=>etat0 |
---|
[149] | 19 | USE etat0_heldsz_mod, ONLY : etat0_heldsz=>etat0 |
---|
| 20 | USE dynetat0_gcm_mod, ONLY : dynetat0_start=>etat0 |
---|
| 21 | USE dynetat0_hz_mod, ONLY : dynetat0_hz=>etat0 |
---|
| 22 | |
---|
[54] | 23 | IMPLICIT NONE |
---|
[17] | 24 | TYPE(t_field),POINTER :: f_ps(:) |
---|
[159] | 25 | TYPE(t_field),POINTER :: f_mass(:) |
---|
[17] | 26 | TYPE(t_field),POINTER :: f_phis(:) |
---|
| 27 | TYPE(t_field),POINTER :: f_theta_rhodz(:) |
---|
| 28 | TYPE(t_field),POINTER :: f_u(:) |
---|
| 29 | TYPE(t_field),POINTER :: f_q(:) |
---|
[186] | 30 | |
---|
[159] | 31 | REAL(rstd),POINTER :: ps(:), mass(:,:) |
---|
| 32 | LOGICAL :: init_mass |
---|
| 33 | INTEGER :: ind,i,j,ij,l |
---|
| 34 | |
---|
| 35 | ! most etat0 routines set ps and not mass |
---|
| 36 | ! in that case and if caldyn_eta == eta_lag |
---|
| 37 | ! the initial distribution of mass is taken to be the same |
---|
| 38 | ! as what the mass coordinate would dictate |
---|
| 39 | ! however if etat0_XXX defines mass then the flag init_mass must be set to .FALSE. |
---|
| 40 | ! otherwise mass will be overwritten |
---|
| 41 | init_mass = (caldyn_eta == eta_lag) |
---|
| 42 | |
---|
[17] | 43 | etat0_type='jablonowsky06' |
---|
| 44 | CALL getin("etat0",etat0_type) |
---|
| 45 | |
---|
| 46 | SELECT CASE (TRIM(etat0_type)) |
---|
[168] | 47 | CASE ('williamson91.6') |
---|
[164] | 48 | CALL etat0_williamson_new(f_phis,f_mass,f_theta_rhodz,f_u, f_q) |
---|
| 49 | init_mass=.FALSE. |
---|
[54] | 50 | CASE ('jablonowsky06') |
---|
| 51 | CALL etat0_jablonowsky06(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
| 52 | CASE ('academic') |
---|
| 53 | CALL etat0_academic(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[170] | 54 | CASE ('held_suarez') |
---|
| 55 | PRINT *,"Held & Suarez (1994) test case" |
---|
[149] | 56 | CALL etat0_heldsz(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[54] | 57 | CASE ('dcmip1') |
---|
| 58 | CALL etat0_dcmip1(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
| 59 | CASE ('dcmip2_mountain','dcmip2_schaer_noshear','dcmip2_schaer_shear') |
---|
| 60 | CALL etat0_dcmip2(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
| 61 | CASE ('dcmip3') |
---|
| 62 | CALL etat0_dcmip3(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[78] | 63 | CASE ('dcmip4') |
---|
[192] | 64 | IF(nqtot<2) THEN |
---|
| 65 | IF (is_mpi_root) THEN |
---|
| 66 | PRINT *, "nqtot must be at least 2 for test case DCMIP4" |
---|
| 67 | END IF |
---|
| 68 | STOP |
---|
| 69 | END IF |
---|
[78] | 70 | CALL etat0_dcmip4(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[113] | 71 | CASE ('dcmip5') |
---|
| 72 | CALL etat0_dcmip5(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[149] | 73 | CASE ('readnf_start') |
---|
| 74 | print*,"readnf_start used" |
---|
| 75 | CALL dynetat0_start(f_ps,f_phis,f_theta_rhodz,f_u,f_q) |
---|
| 76 | CASE ('readnf_hz') |
---|
| 77 | print*,"readnf_hz used" |
---|
| 78 | CALL dynetat0_hz(f_ps,f_phis,f_theta_rhodz,f_u,f_q) |
---|
[62] | 79 | CASE DEFAULT |
---|
[54] | 80 | PRINT*, 'Bad selector for variable etat0 <',etat0_type, & |
---|
[67] | 81 | '> options are <jablonowsky06>, <academic>, <dcmip[1-4]> ' |
---|
[54] | 82 | STOP |
---|
| 83 | END SELECT |
---|
[159] | 84 | |
---|
| 85 | IF(init_mass) THEN ! initialize mass distribution using ps |
---|
[186] | 86 | ! !$OMP BARRIER |
---|
[159] | 87 | DO ind=1,ndomain |
---|
[186] | 88 | IF (.NOT. assigned_domain(ind)) CYCLE |
---|
[159] | 89 | CALL swap_dimensions(ind) |
---|
| 90 | CALL swap_geometry(ind) |
---|
| 91 | mass=f_mass(ind); ps=f_ps(ind) |
---|
| 92 | CALL compute_rhodz(.TRUE., ps, mass) |
---|
| 93 | END DO |
---|
| 94 | END IF |
---|
| 95 | |
---|
[54] | 96 | END SUBROUTINE etat0 |
---|
[17] | 97 | |
---|
[12] | 98 | END MODULE etat0_mod |
---|
[159] | 99 | |
---|