[12] | 1 | MODULE etat0_mod |
---|
[199] | 2 | USE icosa |
---|
[581] | 3 | USE omp_para |
---|
[344] | 4 | IMPLICIT NONE |
---|
[199] | 5 | PRIVATE |
---|
| 6 | |
---|
[149] | 7 | CHARACTER(len=255),SAVE :: etat0_type |
---|
[186] | 8 | !$OMP THREADPRIVATE(etat0_type) |
---|
[12] | 9 | |
---|
[199] | 10 | REAL(rstd) :: etat0_temp |
---|
| 11 | |
---|
[467] | 12 | PUBLIC :: etat0, init_etat0, etat0_type |
---|
[199] | 13 | |
---|
[581] | 14 | ! Important notes for OpenMP |
---|
| 15 | ! When etat0 is called, vertical OpenMP parallelism is deactivated. |
---|
| 16 | ! Therefore only the omp_level_master thread must work, i.e. : |
---|
| 17 | ! !$OMP BARRIER |
---|
| 18 | ! DO ind=1,ndomain |
---|
| 19 | ! IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE |
---|
| 20 | ! ... |
---|
| 21 | ! END DO |
---|
| 22 | ! !$OMP BARRIER |
---|
| 23 | ! There MUST be NO OMP BARRIER inside the DO-LOOP or any routine it calls. |
---|
| 24 | |
---|
[17] | 25 | CONTAINS |
---|
| 26 | |
---|
[467] | 27 | SUBROUTINE init_etat0 |
---|
[581] | 28 | USE etat0_database_mod, ONLY: init_etat0_database => init_etat0 |
---|
| 29 | USE etat0_start_file_mod, ONLY: init_etat0_start_file => init_etat0 |
---|
| 30 | USE etat0_heldsz_mod, ONLY: init_etat0_held_suarez => init_etat0 |
---|
| 31 | |
---|
[467] | 32 | CALL getin("etat0",etat0_type) |
---|
| 33 | |
---|
| 34 | SELECT CASE (TRIM(etat0_type)) |
---|
| 35 | CASE ('isothermal') |
---|
| 36 | CASE ('temperature_profile') |
---|
| 37 | CASE ('jablonowsky06') |
---|
| 38 | CASE ('dcmip5') |
---|
| 39 | CASE ('williamson91.6') |
---|
| 40 | CASE ('start_file') |
---|
[483] | 41 | CALL init_etat0_start_file |
---|
[467] | 42 | CASE ('database') |
---|
| 43 | CALL init_etat0_database |
---|
| 44 | CASE ('academic') |
---|
| 45 | CASE ('held_suarez') |
---|
[544] | 46 | CALL init_etat0_held_suarez |
---|
[467] | 47 | CASE ('venus') |
---|
| 48 | CASE ('dcmip1') |
---|
| 49 | CASE ('dcmip2_mountain','dcmip2_schaer_noshear','dcmip2_schaer_shear') |
---|
| 50 | CASE ('dcmip3') |
---|
| 51 | CASE ('dcmip4') |
---|
[468] | 52 | CASE ('dcmip2016_baroclinic_wave') |
---|
| 53 | CASE ('dcmip2016_cyclone') |
---|
| 54 | CASE ('dcmip2016_supercell') |
---|
[499] | 55 | CASE ('bubble') |
---|
[467] | 56 | CASE DEFAULT |
---|
[468] | 57 | PRINT*, 'Bad selector for variable etat0 <',TRIM(etat0_type),'>'// & |
---|
| 58 | ' options are <isothermal>, <temperature_profile>, <jablonowsky06>, <dcmip5>, <williamson91.6>,'& |
---|
| 59 | //' <start_file>, <database>, <academic>, <held_suarez>, <venus>, <dcmip1>,' & |
---|
| 60 | //' <dcmip2_mountain,dcmip2_schaer_noshear,dcmip2_schaer_shear>, <dcmip3>, <dcmip4>,'& |
---|
[499] | 61 | //' <dcmip2016_baroclinic_wave>, <dcmip2016_cyclone>, <dcmip2016_supercell>', 'bubble' |
---|
[467] | 62 | STOP |
---|
| 63 | END SELECT |
---|
| 64 | |
---|
| 65 | END SUBROUTINE init_etat0 |
---|
| 66 | |
---|
[366] | 67 | SUBROUTINE etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_geopot,f_w, f_q) |
---|
[192] | 68 | USE mpipara, ONLY : is_mpi_root |
---|
[159] | 69 | USE disvert_mod |
---|
[345] | 70 | ! Generic interface |
---|
[344] | 71 | USE etat0_dcmip1_mod, ONLY : getin_etat0_dcmip1=>getin_etat0 |
---|
| 72 | USE etat0_dcmip2_mod, ONLY : getin_etat0_dcmip2=>getin_etat0 |
---|
[346] | 73 | USE etat0_dcmip4_mod, ONLY : getin_etat0_dcmip4=>getin_etat0 |
---|
[203] | 74 | USE etat0_dcmip5_mod, ONLY : getin_etat0_dcmip5=>getin_etat0 |
---|
[377] | 75 | USE etat0_bubble_mod, ONLY : getin_etat0_bubble=>getin_etat0 |
---|
[204] | 76 | USE etat0_williamson_mod, ONLY : getin_etat0_williamson=>getin_etat0 |
---|
[327] | 77 | USE etat0_temperature_mod, ONLY: getin_etat0_temperature=>getin_etat0 |
---|
[382] | 78 | USE etat0_dcmip2016_baroclinic_wave_mod, ONLY : getin_etat0_dcmip2016_baroclinic_wave=>getin_etat0 |
---|
[388] | 79 | USE etat0_dcmip2016_cyclone_mod, ONLY : getin_etat0_dcmip2016_cyclone=>getin_etat0 |
---|
| 80 | USE etat0_dcmip2016_supercell_mod, ONLY : getin_etat0_dcmip2016_supercell=>getin_etat0 |
---|
[345] | 81 | ! Ad hoc interfaces |
---|
[467] | 82 | USE etat0_academic_mod, ONLY : etat0_academic=>etat0 |
---|
| 83 | USE etat0_heldsz_mod, ONLY : etat0_heldsz=>etat0 |
---|
| 84 | USE etat0_venus_mod, ONLY : etat0_venus=>etat0 |
---|
| 85 | USE etat0_database_mod, ONLY : etat0_database=>etat0 |
---|
[266] | 86 | USE etat0_start_file_mod, ONLY : etat0_start_file=>etat0 |
---|
[149] | 87 | |
---|
[17] | 88 | TYPE(t_field),POINTER :: f_ps(:) |
---|
[159] | 89 | TYPE(t_field),POINTER :: f_mass(:) |
---|
[17] | 90 | TYPE(t_field),POINTER :: f_phis(:) |
---|
| 91 | TYPE(t_field),POINTER :: f_theta_rhodz(:) |
---|
| 92 | TYPE(t_field),POINTER :: f_u(:) |
---|
[366] | 93 | TYPE(t_field),POINTER :: f_geopot(:) |
---|
| 94 | TYPE(t_field),POINTER :: f_w(:) |
---|
[17] | 95 | TYPE(t_field),POINTER :: f_q(:) |
---|
[186] | 96 | |
---|
[159] | 97 | REAL(rstd),POINTER :: ps(:), mass(:,:) |
---|
[366] | 98 | LOGICAL :: autoinit_mass, autoinit_geopot, collocated |
---|
[159] | 99 | INTEGER :: ind,i,j,ij,l |
---|
| 100 | |
---|
| 101 | ! most etat0 routines set ps and not mass |
---|
| 102 | ! in that case and if caldyn_eta == eta_lag |
---|
| 103 | ! the initial distribution of mass is taken to be the same |
---|
| 104 | ! as what the mass coordinate would dictate |
---|
[366] | 105 | ! however if etat0_XXX defines mass then the flag autoinit_mass must be set to .FALSE. |
---|
[159] | 106 | ! otherwise mass will be overwritten |
---|
[366] | 107 | autoinit_mass = (caldyn_eta == eta_lag) |
---|
[159] | 108 | |
---|
[17] | 109 | etat0_type='jablonowsky06' |
---|
| 110 | CALL getin("etat0",etat0_type) |
---|
| 111 | |
---|
[345] | 112 | !------------------- Generic interface --------------------- |
---|
[344] | 113 | collocated=.TRUE. |
---|
[17] | 114 | SELECT CASE (TRIM(etat0_type)) |
---|
[199] | 115 | CASE ('isothermal') |
---|
| 116 | CALL getin_etat0_isothermal |
---|
[327] | 117 | CASE ('temperature_profile') |
---|
| 118 | CALL getin_etat0_temperature |
---|
[203] | 119 | CASE ('jablonowsky06') |
---|
[344] | 120 | CASE ('dcmip1') |
---|
| 121 | CALL getin_etat0_dcmip1 |
---|
| 122 | CASE ('dcmip2_mountain','dcmip2_schaer_noshear','dcmip2_schaer_shear') |
---|
| 123 | CALL getin_etat0_dcmip2 |
---|
[345] | 124 | CASE ('dcmip3') |
---|
[346] | 125 | CASE ('dcmip4') |
---|
| 126 | CALL getin_etat0_dcmip4 |
---|
[344] | 127 | CASE ('dcmip5') |
---|
[203] | 128 | CALL getin_etat0_dcmip5 |
---|
[377] | 129 | CASE ('bubble') |
---|
| 130 | CALL getin_etat0_bubble |
---|
[168] | 131 | CASE ('williamson91.6') |
---|
[366] | 132 | autoinit_mass=.FALSE. |
---|
[204] | 133 | CALL getin_etat0_williamson |
---|
[382] | 134 | CASE ('dcmip2016_baroclinic_wave') |
---|
| 135 | CALL getin_etat0_dcmip2016_baroclinic_wave |
---|
[388] | 136 | CASE ('dcmip2016_cyclone') |
---|
| 137 | CALL getin_etat0_dcmip2016_cyclone |
---|
| 138 | CASE ('dcmip2016_supercell') |
---|
| 139 | CALL getin_etat0_dcmip2016_supercell |
---|
[344] | 140 | CASE DEFAULT |
---|
| 141 | collocated=.FALSE. |
---|
[366] | 142 | autoinit_mass = .FALSE. |
---|
[344] | 143 | END SELECT |
---|
| 144 | |
---|
[345] | 145 | !------------------- Ad hoc interfaces -------------------- |
---|
[344] | 146 | SELECT CASE (TRIM(etat0_type)) |
---|
[467] | 147 | CASE ('database') |
---|
| 148 | CALL etat0_database(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[266] | 149 | CASE ('start_file') |
---|
| 150 | CALL etat0_start_file(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[54] | 151 | CASE ('academic') |
---|
| 152 | CALL etat0_academic(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[170] | 153 | CASE ('held_suarez') |
---|
| 154 | PRINT *,"Held & Suarez (1994) test case" |
---|
[149] | 155 | CALL etat0_heldsz(f_ps,f_phis,f_theta_rhodz,f_u, f_q) |
---|
[325] | 156 | CASE ('venus') |
---|
| 157 | CALL etat0_venus(f_ps, f_phis, f_theta_rhodz, f_u, f_q) |
---|
| 158 | PRINT *, "Venus (Lebonnois et al., 2012) test case" |
---|
[62] | 159 | CASE DEFAULT |
---|
[344] | 160 | IF(collocated) THEN |
---|
[366] | 161 | CALL etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_geopot,f_W, f_q) |
---|
[344] | 162 | ELSE |
---|
[468] | 163 | PRINT*, 'Bad selector for variable etat0 <',TRIM(etat0_type),'>'// & |
---|
| 164 | ' options are <isothermal>, <temperature_profile>, <jablonowsky06>, <dcmip5>, <williamson91.6>,'& |
---|
| 165 | //' <start_file>, <database>, <academic>, <held_suarez>, <venus>, <dcmip1>,' & |
---|
| 166 | //' <dcmip2_mountain,dcmip2_schaer_noshear,dcmip2_schaer_shear>, <dcmip3>, <dcmip4>,'& |
---|
| 167 | //' <dcmip2016_baroclinic_wave>, <dcmip2016_cyclone>, <dcmip2016_supercell>' |
---|
[344] | 168 | STOP |
---|
| 169 | END IF |
---|
[54] | 170 | END SELECT |
---|
[159] | 171 | |
---|
[366] | 172 | IF(autoinit_mass) THEN |
---|
[159] | 173 | DO ind=1,ndomain |
---|
[581] | 174 | IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE |
---|
[159] | 175 | CALL swap_dimensions(ind) |
---|
| 176 | CALL swap_geometry(ind) |
---|
| 177 | mass=f_mass(ind); ps=f_ps(ind) |
---|
[366] | 178 | CALL compute_rhodz(.TRUE., ps, mass) ! initialize mass distribution using ps |
---|
[159] | 179 | END DO |
---|
| 180 | END IF |
---|
[366] | 181 | |
---|
[54] | 182 | END SUBROUTINE etat0 |
---|
[199] | 183 | |
---|
[366] | 184 | SUBROUTINE etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_geopot,f_W, f_q) |
---|
[295] | 185 | USE theta2theta_rhodz_mod |
---|
[199] | 186 | TYPE(t_field),POINTER :: f_ps(:) |
---|
| 187 | TYPE(t_field),POINTER :: f_mass(:) |
---|
| 188 | TYPE(t_field),POINTER :: f_phis(:) |
---|
| 189 | TYPE(t_field),POINTER :: f_theta_rhodz(:) |
---|
| 190 | TYPE(t_field),POINTER :: f_u(:) |
---|
[366] | 191 | TYPE(t_field),POINTER :: f_geopot(:) |
---|
| 192 | TYPE(t_field),POINTER :: f_W(:) |
---|
[199] | 193 | TYPE(t_field),POINTER :: f_q(:) |
---|
| 194 | |
---|
[321] | 195 | TYPE(t_field),POINTER,SAVE :: f_temp(:) |
---|
[199] | 196 | REAL(rstd),POINTER :: ps(:) |
---|
| 197 | REAL(rstd),POINTER :: mass(:,:) |
---|
| 198 | REAL(rstd),POINTER :: phis(:) |
---|
[387] | 199 | REAL(rstd),POINTER :: theta_rhodz(:,:,:) |
---|
[295] | 200 | REAL(rstd),POINTER :: temp(:,:) |
---|
[199] | 201 | REAL(rstd),POINTER :: u(:,:) |
---|
[366] | 202 | REAL(rstd),POINTER :: geopot(:,:) |
---|
| 203 | REAL(rstd),POINTER :: W(:,:) |
---|
[199] | 204 | REAL(rstd),POINTER :: q(:,:,:) |
---|
| 205 | INTEGER :: ind |
---|
| 206 | |
---|
[321] | 207 | CALL allocate_field(f_temp,field_t,type_real,llm,name='temp') |
---|
| 208 | |
---|
[199] | 209 | DO ind=1,ndomain |
---|
[581] | 210 | IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE |
---|
| 211 | ! IF (.NOT. assigned_domain(ind)) CYCLE |
---|
[199] | 212 | CALL swap_dimensions(ind) |
---|
| 213 | CALL swap_geometry(ind) |
---|
| 214 | ps=f_ps(ind) |
---|
| 215 | mass=f_mass(ind) |
---|
| 216 | phis=f_phis(ind) |
---|
| 217 | theta_rhodz=f_theta_rhodz(ind) |
---|
[295] | 218 | temp=f_temp(ind) |
---|
[199] | 219 | u=f_u(ind) |
---|
[366] | 220 | geopot=f_geopot(ind) |
---|
| 221 | w=f_w(ind) |
---|
[199] | 222 | q=f_q(ind) |
---|
[295] | 223 | |
---|
[366] | 224 | IF( TRIM(etat0_type)=='williamson91.6' ) THEN |
---|
[387] | 225 | CALL compute_etat0_collocated(ps,mass, phis, theta_rhodz(:,:,1), u, geopot, W, q) |
---|
[295] | 226 | ELSE |
---|
[387] | 227 | CALL compute_etat0_collocated(ps,mass, phis, temp, u, geopot, W, q) |
---|
[295] | 228 | ENDIF |
---|
[401] | 229 | |
---|
| 230 | IF( TRIM(etat0_type)/='williamson91.6' ) CALL compute_temperature2entropy(ps,temp,q,theta_rhodz, 1) |
---|
| 231 | |
---|
[199] | 232 | ENDDO |
---|
[295] | 233 | |
---|
[321] | 234 | CALL deallocate_field(f_temp) |
---|
[295] | 235 | |
---|
[199] | 236 | END SUBROUTINE etat0_collocated |
---|
| 237 | |
---|
[401] | 238 | SUBROUTINE compute_temperature2entropy(ps,temp,q,theta_rhodz,offset) |
---|
| 239 | USE icosa |
---|
| 240 | USE pression_mod |
---|
| 241 | USE exner_mod |
---|
| 242 | USE omp_para |
---|
| 243 | REAL(rstd),INTENT(IN) :: ps(iim*jjm) |
---|
| 244 | REAL(rstd),INTENT(IN) :: temp(iim*jjm,llm) |
---|
| 245 | REAL(rstd),INTENT(IN) :: q(iim*jjm,llm,nqtot) |
---|
| 246 | REAL(rstd),INTENT(OUT) :: theta_rhodz(iim*jjm,llm) |
---|
| 247 | INTEGER,INTENT(IN) :: offset |
---|
| 248 | |
---|
| 249 | REAL(rstd) :: p(iim*jjm,llm+1) |
---|
| 250 | REAL(rstd) :: cppd,Rd, mass, p_ij, q_ij,r_ij, chi,nu, entropy, theta |
---|
| 251 | INTEGER :: i,j,ij,l |
---|
| 252 | |
---|
| 253 | cppd=cpp |
---|
| 254 | Rd=kappa*cppd |
---|
| 255 | |
---|
| 256 | CALL compute_pression(ps,p,offset) |
---|
| 257 | ! flush p |
---|
| 258 | DO l = ll_begin, ll_end |
---|
| 259 | DO j=jj_begin-offset,jj_end+offset |
---|
| 260 | DO i=ii_begin-offset,ii_end+offset |
---|
| 261 | ij=(j-1)*iim+i |
---|
| 262 | mass = (p(ij,l)-p(ij,l+1))/g ! dry+moist mass |
---|
| 263 | p_ij = .5*(p(ij,l)+p(ij,l+1)) ! pressure at full level |
---|
| 264 | SELECT CASE(caldyn_thermo) |
---|
| 265 | CASE(thermo_theta) |
---|
| 266 | theta = temp(ij,l)*(p_ij/preff)**(-kappa) |
---|
| 267 | theta_rhodz(ij,l) = mass * theta |
---|
| 268 | CASE(thermo_entropy) |
---|
| 269 | nu = log(p_ij/preff) |
---|
| 270 | chi = log(temp(ij,l)/Treff) |
---|
| 271 | entropy = cppd*chi-Rd*nu |
---|
| 272 | theta_rhodz(ij,l) = mass * entropy |
---|
| 273 | ! CASE(thermo_moist) |
---|
| 274 | ! q_ij=q(ij,l,1) |
---|
| 275 | ! r_ij=1.-q_ij |
---|
| 276 | ! mass=mass*(1-q_ij) ! dry mass |
---|
| 277 | ! nu = log(p_ij/preff) |
---|
| 278 | ! chi = log(temp(ij,l)/Treff) |
---|
| 279 | ! entropy = r_ij*(cppd*chi-Rd*nu) + q_ij*(cppv*chi-Rv*nu) |
---|
| 280 | ! theta_rhodz(ij,l) = mass * entropy |
---|
| 281 | CASE DEFAULT |
---|
| 282 | STOP |
---|
| 283 | END SELECT |
---|
| 284 | ENDDO |
---|
| 285 | ENDDO |
---|
| 286 | ENDDO |
---|
| 287 | END SUBROUTINE compute_temperature2entropy |
---|
| 288 | |
---|
[366] | 289 | SUBROUTINE compute_etat0_collocated(ps,mass,phis,temp_i,u, geopot,W, q) |
---|
[199] | 290 | USE wind_mod |
---|
[366] | 291 | USE disvert_mod |
---|
[203] | 292 | USE etat0_jablonowsky06_mod, ONLY : compute_jablonowsky06 => compute_etat0 |
---|
[344] | 293 | USE etat0_dcmip1_mod, ONLY : compute_dcmip1 => compute_etat0 |
---|
| 294 | USE etat0_dcmip2_mod, ONLY : compute_dcmip2 => compute_etat0 |
---|
[345] | 295 | USE etat0_dcmip3_mod, ONLY : compute_dcmip3 => compute_etat0 |
---|
[346] | 296 | USE etat0_dcmip4_mod, ONLY : compute_dcmip4 => compute_etat0 |
---|
[203] | 297 | USE etat0_dcmip5_mod, ONLY : compute_dcmip5 => compute_etat0 |
---|
[377] | 298 | USE etat0_bubble_mod, ONLY : compute_bubble => compute_etat0 |
---|
[204] | 299 | USE etat0_williamson_mod, ONLY : compute_w91_6 => compute_etat0 |
---|
[327] | 300 | USE etat0_temperature_mod, ONLY: compute_etat0_temperature => compute_etat0 |
---|
[382] | 301 | USE etat0_dcmip2016_baroclinic_wave_mod, ONLY : compute_dcmip2016_baroclinic_wave => compute_etat0 |
---|
[388] | 302 | USE etat0_dcmip2016_cyclone_mod, ONLY : compute_dcmip2016_cyclone => compute_etat0 |
---|
| 303 | USE etat0_dcmip2016_supercell_mod, ONLY : compute_dcmip2016_supercell => compute_etat0 |
---|
[199] | 304 | REAL(rstd),INTENT(INOUT) :: ps(iim*jjm) |
---|
| 305 | REAL(rstd),INTENT(INOUT) :: mass(iim*jjm,llm) |
---|
| 306 | REAL(rstd),INTENT(OUT) :: phis(iim*jjm) |
---|
[295] | 307 | REAL(rstd),INTENT(OUT) :: temp_i(iim*jjm,llm) |
---|
[199] | 308 | REAL(rstd),INTENT(OUT) :: u(3*iim*jjm,llm) |
---|
[366] | 309 | REAL(rstd),INTENT(OUT) :: W(iim*jjm,llm+1) |
---|
| 310 | REAL(rstd),INTENT(OUT) :: geopot(iim*jjm,llm+1) |
---|
[199] | 311 | REAL(rstd),INTENT(OUT) :: q(iim*jjm,llm,nqtot) |
---|
| 312 | |
---|
| 313 | REAL(rstd) :: ulon_i(iim*jjm,llm) |
---|
| 314 | REAL(rstd) :: ulat_i(iim*jjm,llm) |
---|
| 315 | |
---|
| 316 | REAL(rstd) :: ps_e(3*iim*jjm) |
---|
| 317 | REAL(rstd) :: mass_e(3*iim*jjm,llm) |
---|
| 318 | REAL(rstd) :: phis_e(3*iim*jjm) |
---|
| 319 | REAL(rstd) :: temp_e(3*iim*jjm,llm) |
---|
[366] | 320 | REAL(rstd) :: geopot_e(3*iim*jjm,llm+1) |
---|
[199] | 321 | REAL(rstd) :: ulon_e(3*iim*jjm,llm) |
---|
| 322 | REAL(rstd) :: ulat_e(3*iim*jjm,llm) |
---|
| 323 | REAL(rstd) :: q_e(3*iim*jjm,llm,nqtot) |
---|
| 324 | |
---|
| 325 | INTEGER :: l,i,j,ij |
---|
[366] | 326 | REAL :: p_ik, v_ik, mass_ik |
---|
| 327 | LOGICAL :: autoinit_mass, autoinit_NH |
---|
[199] | 328 | |
---|
[366] | 329 | ! For NH geopotential and vertical momentum must be initialized. |
---|
[377] | 330 | ! Unless autoinit_NH is set to .FALSE. , they will be initialized |
---|
[366] | 331 | ! to hydrostatic geopotential and zero |
---|
| 332 | autoinit_mass = .TRUE. |
---|
| 333 | autoinit_NH = .NOT. hydrostatic |
---|
| 334 | w(:,:) = 0 |
---|
| 335 | |
---|
[199] | 336 | SELECT CASE (TRIM(etat0_type)) |
---|
| 337 | CASE ('isothermal') |
---|
[201] | 338 | CALL compute_etat0_isothermal(iim*jjm, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 339 | CALL compute_etat0_isothermal(3*iim*jjm, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
[327] | 340 | CASE ('temperature_profile') |
---|
| 341 | CALL compute_etat0_temperature(iim*jjm, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 342 | CALL compute_etat0_temperature(3*iim*jjm, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
[201] | 343 | CASE('jablonowsky06') |
---|
| 344 | CALL compute_jablonowsky06(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i) |
---|
| 345 | CALL compute_jablonowsky06(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e) |
---|
[344] | 346 | CASE('dcmip1') |
---|
| 347 | CALL compute_dcmip1(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 348 | CALL compute_dcmip1(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
| 349 | CASE ('dcmip2_mountain','dcmip2_schaer_noshear','dcmip2_schaer_shear') |
---|
| 350 | CALL compute_dcmip2(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i) |
---|
| 351 | CALL compute_dcmip2(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e) |
---|
[345] | 352 | CASE('dcmip3') |
---|
[366] | 353 | CALL compute_dcmip3(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, geopot, q) |
---|
| 354 | CALL compute_dcmip3(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, geopot_e, q_e) |
---|
| 355 | autoinit_NH = .FALSE. ! compute_dcmip3 initializes geopot |
---|
[346] | 356 | CASE('dcmip4') |
---|
| 357 | CALL compute_dcmip4(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 358 | CALL compute_dcmip4(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
[203] | 359 | CASE('dcmip5') |
---|
| 360 | CALL compute_dcmip5(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 361 | CALL compute_dcmip5(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
[377] | 362 | CASE('bubble') |
---|
| 363 | CALL compute_bubble(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, geopot, q) |
---|
| 364 | CALL compute_bubble(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, geopot_e, q_e) |
---|
| 365 | ! autoinit_NH = .FALSE. ! compute_bubble initializes geopot |
---|
[204] | 366 | CASE('williamson91.6') |
---|
[295] | 367 | CALL compute_w91_6(iim*jjm,lon_i,lat_i, phis, mass(:,1), temp_i(:,1), ulon_i(:,1), ulat_i(:,1)) |
---|
[204] | 368 | CALL compute_w91_6(3*iim*jjm,lon_e,lat_e, phis_e, mass_e(:,1), temp_e(:,1), ulon_e(:,1), ulat_e(:,1)) |
---|
[366] | 369 | autoinit_mass = .FALSE. ! do not overwrite mass |
---|
[382] | 370 | CASE('dcmip2016_baroclinic_wave') |
---|
| 371 | CALL compute_dcmip2016_baroclinic_wave(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 372 | CALL compute_dcmip2016_baroclinic_wave(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
[388] | 373 | CASE('dcmip2016_cyclone') |
---|
| 374 | CALL compute_dcmip2016_cyclone(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 375 | CALL compute_dcmip2016_cyclone(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
| 376 | CASE('dcmip2016_supercell') |
---|
| 377 | CALL compute_dcmip2016_supercell(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) |
---|
| 378 | CALL compute_dcmip2016_supercell(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) |
---|
[199] | 379 | END SELECT |
---|
| 380 | |
---|
[366] | 381 | IF(autoinit_mass) CALL compute_rhodz(.TRUE., ps, mass) ! initialize mass distribution using ps |
---|
| 382 | IF(autoinit_NH) THEN |
---|
| 383 | geopot(:,1) = phis(:) ! surface geopotential |
---|
| 384 | DO l = 1, llm |
---|
| 385 | DO ij=1,iim*jjm |
---|
| 386 | ! hybrid pressure coordinate |
---|
| 387 | p_ik = ptop + mass_ak(l) + mass_bk(l)*ps(ij) |
---|
| 388 | mass_ik = (mass_dak(l) + mass_dbk(l)*ps(ij))/g |
---|
| 389 | ! v=R.T/p, R=kappa*cpp |
---|
| 390 | v_ik = kappa*cpp*temp_i(ij,l)/p_ik |
---|
| 391 | geopot(ij,l+1) = geopot(ij,l) + mass_ik*v_ik*g |
---|
| 392 | END DO |
---|
| 393 | END DO |
---|
| 394 | END IF |
---|
| 395 | |
---|
[201] | 396 | CALL compute_wind_perp_from_lonlat_compound(ulon_e, ulat_e, u) |
---|
[199] | 397 | |
---|
[201] | 398 | END SUBROUTINE compute_etat0_collocated |
---|
| 399 | |
---|
[199] | 400 | !----------------------------- Resting isothermal state -------------------------------- |
---|
| 401 | |
---|
| 402 | SUBROUTINE getin_etat0_isothermal |
---|
[201] | 403 | etat0_temp=300 |
---|
| 404 | CALL getin("etat0_isothermal_temp",etat0_temp) |
---|
[199] | 405 | END SUBROUTINE getin_etat0_isothermal |
---|
| 406 | |
---|
| 407 | SUBROUTINE compute_etat0_isothermal(ngrid, phis, ps, temp, ulon, ulat, q) |
---|
| 408 | INTEGER, INTENT(IN) :: ngrid |
---|
| 409 | REAL(rstd),INTENT(OUT) :: phis(ngrid) |
---|
| 410 | REAL(rstd),INTENT(OUT) :: ps(ngrid) |
---|
| 411 | REAL(rstd),INTENT(OUT) :: temp(ngrid,llm) |
---|
| 412 | REAL(rstd),INTENT(OUT) :: ulon(ngrid,llm) |
---|
| 413 | REAL(rstd),INTENT(OUT) :: ulat(ngrid,llm) |
---|
| 414 | REAL(rstd),INTENT(OUT) :: q(ngrid,llm,nqtot) |
---|
| 415 | phis(:)=0 |
---|
| 416 | ps(:)=preff |
---|
| 417 | temp(:,:)=etat0_temp |
---|
| 418 | ulon(:,:)=0 |
---|
| 419 | ulat(:,:)=0 |
---|
| 420 | q(:,:,:)=0 |
---|
| 421 | END SUBROUTINE compute_etat0_isothermal |
---|
| 422 | |
---|
[12] | 423 | END MODULE etat0_mod |
---|