Changeset 953 for codes/icosagcm/trunk/src/time/timeloop_gcm.F90
- Timestamp:
- 07/15/19 12:29:31 (5 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/time/timeloop_gcm.F90
r933 r953 94 94 END SELECT 95 95 96 IF (scheme_family /= hevi) THEN 97 CALL abort_acc("scheme_family /= hevi") 98 END IF 99 96 100 ! Time-independant orography 97 101 CALL allocate_field(f_phis,field_t,type_real,name='phis') … … 103 107 CALL allocate_field(f_u,field_u,type_real,llm,name='u') 104 108 CALL allocate_field(f_geopot,field_t,type_real,llm+1,name='geopot') 105 CALL allocate_field(f_W,field_t,type_real,llm+1,name='W') 109 CALL allocate_field(f_W,field_t,type_real,llm+1,name='W') ! used only if .not. hydrostatic 106 110 CALL allocate_field(f_q,field_t,type_real,llm,nqtot,'q') 107 111 ! Mass fluxes 108 CALL allocate_field(f_hflux,field_u,type_real,llm ) ! instantaneous mass fluxes109 CALL allocate_field(f_hfluxt,field_u,type_real,llm ) ! mass "fluxes" accumulated in time112 CALL allocate_field(f_hflux,field_u,type_real,llm, ondevice=.TRUE.) ! instantaneous mass fluxes 113 CALL allocate_field(f_hfluxt,field_u,type_real,llm,ondevice=.TRUE.) ! mass "fluxes" accumulated in time 110 114 CALL allocate_field(f_wflux,field_t,type_real,llm+1) ! vertical mass fluxes 111 CALL allocate_field(f_wfluxt,field_t,type_real,llm+1,name='wfluxt' )115 CALL allocate_field(f_wfluxt,field_t,type_real,llm+1,name='wfluxt',ondevice=.TRUE.) 112 116 113 117 SELECT CASE(scheme_family) … … 125 129 CASE(hevi) 126 130 ! Trends 127 CALL allocate_fields(nb_stage,f_dps_slow, field_t,type_real,name='dps_slow' )128 CALL allocate_fields(nb_stage,f_dmass_slow, field_t,type_real,llm, name='dmass_slow' )129 CALL allocate_fields(nb_stage,f_dtheta_rhodz_slow, field_t,type_real,llm,nqdyn,name='dtheta_rhodz_fast' )130 CALL allocate_fields(nb_stage,f_du_slow, field_u,type_real,llm,name='du_slow' )131 CALL allocate_fields(nb_stage,f_du_fast, field_u,type_real,llm,name='du_fast' )131 CALL allocate_fields(nb_stage,f_dps_slow, field_t,type_real,name='dps_slow', ondevice=.TRUE.) 132 CALL allocate_fields(nb_stage,f_dmass_slow, field_t,type_real,llm, name='dmass_slow', ondevice=.TRUE.) 133 CALL allocate_fields(nb_stage,f_dtheta_rhodz_slow, field_t,type_real,llm,nqdyn,name='dtheta_rhodz_fast', ondevice=.TRUE.) 134 CALL allocate_fields(nb_stage,f_du_slow, field_u,type_real,llm,name='du_slow', ondevice=.TRUE.) 135 CALL allocate_fields(nb_stage,f_du_fast, field_u,type_real,llm,name='du_fast', ondevice=.TRUE.) 132 136 CALL allocate_fields(nb_stage,f_dW_slow, field_t,type_real,llm+1,name='dW_slow') 133 137 CALL allocate_fields(nb_stage,f_dW_fast, field_t,type_real,llm+1,name='dW_fast') … … 172 176 173 177 SUBROUTINE timeloop 178 USE abort_mod 174 179 USE dissip_gcm_mod 175 180 USE sponge_mod … … 211 216 rhodz=f_rhodz(ind); mass=f_mass(ind); ps=f_ps(ind) 212 217 IF(caldyn_eta==eta_mass) THEN 213 CALL compute_rhodz(.TRUE., ps, rhodz ) ! save rhodz for transport scheme before dynamics update ps218 CALL compute_rhodz(.TRUE., ps, rhodz, ondevice=.FALSE.) ! save rhodz for transport scheme before dynamics update ps 214 219 ELSE 215 220 DO l=ll_begin,ll_end … … 244 249 CALL SYSTEM_CLOCK(start_clock, rate_clock) 245 250 !$OMP END MASTER 251 call update_device_field(f_ps) 252 call update_device_field(f_mass) 253 CALL update_device_field(f_theta_rhodz) 254 CALL update_device_field(f_u) 255 CALL update_device_field(f_q) 256 CALL update_device_field(f_geopot) 257 CALL update_device_field(f_wflux) 258 CALL update_device_field(f_rhodz) 259 246 260 247 261 DO it=itau0+1,itau0+itaumax … … 263 277 CALL wait_message(req_mass0) 264 278 CALL send_message(f_theta_rhodz,req_theta_rhodz0) 265 CALL wait_message(req_theta_rhodz0) 279 CALL wait_message(req_theta_rhodz0) 266 280 CALL send_message(f_u,req_u0) 267 281 CALL wait_message(req_u0) … … 281 295 SELECT CASE(scheme_family) 282 296 CASE(explicit) 297 CALL abort_acc("explicit_scheme") 283 298 CALL explicit_scheme(it, fluxt_zero) 284 299 CASE(hevi) … … 298 313 CALL swap_geometry(ind) 299 314 mass=f_mass(ind); ps=f_ps(ind); 300 CALL compute_rhodz(.TRUE., ps, mass )315 CALL compute_rhodz(.TRUE., ps, mass, ondevice=.TRUE.) 301 316 END DO 302 317 ENDIF … … 311 326 CALL euler_scheme(.FALSE.) ! update only u, theta 312 327 IF (iflag_sponge > 0) THEN 328 CALL abort_acc("iflag_sponge>0") 313 329 CALL sponge(f_u,f_du,f_theta_rhodz,f_dtheta_rhodz) 314 330 CALL euler_scheme(.FALSE.) ! update only u, theta … … 321 337 END IF 322 338 CALL exit_profile(id_dissip) 323 339 324 340 CALL enter_profile(id_adv) 325 341 IF(MOD(it,itau_adv)==0) THEN … … 329 345 ! At this point advect_tracer has obtained the halos of u and rhodz, 330 346 ! needed for correct computation of kinetic energy 347 IF(diagflux_on) CALL abort_acc("diagflux_on") 331 348 IF(diagflux_on) CALL diagflux_energy(adv_over_out, f_phis,f_rhodz,f_theta_rhodz,f_u, f_geopot,f_theta,f_buf_i, f_hfluxt) 332 349 … … 340 357 END DO 341 358 ENDIF 359 IF(positive_theta) CALL abort_acc("positive_theta") 342 360 IF(positive_theta) CALL copy_q_to_theta(f_theta_rhodz,f_rhodz,f_q) 343 361 END IF 344 362 CALL exit_profile(id_adv) 345 363 346 364 CALL enter_profile(id_diags) 347 365 ! IF (MOD(it,itau_physics)==0) THEN … … 360 378 361 379 IF (MOD(it,itau_check_conserv)==0) THEN 380 CALL update_host_field(f_ps) 381 CALL update_host_field(f_theta_rhodz) 382 CALL update_host_field(f_u) 383 CALL update_host_field(f_dps) 384 CALL update_host_field(f_q) 362 385 CALL check_conserve_detailed(it, AAM_dyn, & 363 386 f_ps,f_dps,f_u,f_theta_rhodz,f_phis) … … 367 390 IF (mod(it,itau_out)==0 ) THEN 368 391 CALL transfert_request(f_u,req_e1_vect) 392 CALL update_host_field(f_ps) 393 CALL update_host_field(f_mass) 394 CALL update_host_field(f_theta_rhodz) 395 CALL update_host_field(f_geopot) 396 CALL update_host_field(f_u) 397 CALL update_host_field(f_q) 369 398 CALL write_output_fields_basic(.FALSE.,f_phis, f_ps, f_mass, f_geopot, f_theta_rhodz, f_u, f_W, f_q) 370 399 ENDIF … … 374 403 END DO 375 404 405 CALL update_host_field(f_ps) 406 CALL update_host_field(f_theta_rhodz) 407 CALL update_host_field(f_u) 408 CALL update_host_field(f_q) 409 CALL update_host_field(f_geopot) 410 376 411 ! CALL write_etat0(itau0+itaumax,f_ps, f_phis,f_theta_rhodz,f_u,f_q) 377 412 CALL write_etat0(itau0+itaumax,f_ps, f_phis,f_theta_rhodz,f_u,f_q, f_geopot, f_W) 378 413 414 CALL update_host_field(f_dps) 379 415 CALL check_conserve_detailed(it, AAM_dyn, & 380 416 f_ps,f_dps,f_u,f_theta_rhodz,f_phis)
Note: See TracChangeset
for help on using the changeset viewer.