- Timestamp:
- 02/28/20 10:18:33 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/time/timeloop_gcm.F90
r962 r1015 11 11 PRIVATE 12 12 13 INTEGER, PARAMETER :: itau_sync=1013 INTEGER, PARAMETER :: sync_it=10 14 14 TYPE(t_message),SAVE :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0, req_W0, req_geopot0 15 15 LOGICAL, SAVE :: positive_theta … … 203 203 LOGICAL, PARAMETER :: check_rhodz=.FALSE. 204 204 INTEGER(kind=8) :: start_clock, stop_clock, rate_clock 205 INTEGER :: itau_sync ! best iteration for synchronisation and ensure 1+1=2 206 INTEGER :: i 207 205 208 LOGICAL,SAVE :: first_physic=.TRUE. 206 209 !$OMP THREADPRIVATE(first_physic) 207 210 211 itau_sync=1 212 DO i=2,3*sync_it 213 IF (MOD(86400,INT(i*dt))==0 .AND. ABS((sync_it-itau_sync)*1./sync_it )/sync_it < (sync_it-itau_sync)*1./sync_it) itau_sync=i 214 ENDDO 215 IF (is_master) PRINT*,"Synchronize frontier every itau_sync =",itau_sync 216 208 217 CALL switch_omp_distrib_level 209 218 CALL caldyn_BC(f_phis, f_geopot, f_wflux) ! set constant values in first/last interfaces … … 261 270 262 271 DO it=itau0+1,itau0+itaumax 272 263 273 CALL print_iteration(it, itau0, itaumax, start_clock, rate_clock) 264 274 … … 272 282 END IF 273 283 274 IF (it==itau0+1 .OR. MOD(it ,itau_sync)==0) THEN284 IF (it==itau0+1 .OR. MOD(it-1,itau_sync)==0) THEN 275 285 CALL send_message(f_ps,req_ps0) 276 286 CALL wait_message(req_ps0) … … 291 301 ENDIF 292 302 303 ! CALL checksum(f_ps) 304 ! CALL checksum(f_theta_rhodz) 305 ! CALL checksum(f_u) 306 ! CALL checksum(f_q) 307 ! CALL checksum(f_mass) 308 ! CALL checksum(f_geopot) 309 ! CALL checksum(f_rhodz) 310 ! CALL checksum(f_wflux) 311 293 312 CALL guided(it*dt,f_ps,f_theta_rhodz,f_u,f_q) 294 313 … … 302 321 END SELECT 303 322 CALL exit_profile(id_dyn) 323 324 ! CALL checksum(f_ps) 325 ! CALL checksum(f_theta_rhodz) 326 ! CALL checksum(f_u) 327 ! CALL checksum(f_q) 328 ! CALL checksum(f_mass) 329 ! CALL checksum(f_geopot) 330 ! CALL checksum(f_rhodz) 331 ! CALL checksum(f_wflux) 304 332 305 333 CALL enter_profile(id_dissip) … … 338 366 END IF 339 367 CALL exit_profile(id_dissip) 368 ! CALL checksum(f_ps) 369 ! CALL checksum(f_theta_rhodz) 370 ! CALL checksum(f_u) 371 ! CALL checksum(f_q) 372 ! CALL checksum(f_hfluxt) 373 ! CALL checksum(f_wfluxt) 374 ! CALL checksum(f_u) 375 ! CALL checksum(f_rhodz) 340 376 341 377 CALL enter_profile(id_adv) … … 349 385 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) 350 386 351 IF (check_rhodz) THEN ! check that rhodz is consistent with ps 352 DO ind=1,ndomain 353 IF (.NOT. assigned_domain(ind)) CYCLE 354 CALL swap_dimensions(ind) 355 CALL swap_geometry(ind) 356 rhodz=f_rhodz(ind); ps=f_ps(ind); 357 CALL compute_rhodz(.FALSE., ps, rhodz) 358 END DO 359 ENDIF 387 DO ind=1,ndomain 388 IF (.NOT. assigned_domain(ind)) CYCLE 389 CALL swap_dimensions(ind) 390 CALL swap_geometry(ind) 391 rhodz=f_rhodz(ind); mass=f_mass(ind); ps=f_ps(ind) 392 IF(caldyn_eta==eta_mass) THEN 393 CALL compute_rhodz(.TRUE., ps, rhodz, ondevice=.TRUE.) ! save rhodz for transport scheme before dynamics update ps 394 ELSE 395 DO l=ll_begin,ll_end 396 rhodz(:,l)=mass(:,l) 397 ENDDO 398 END IF 399 END DO 400 360 401 IF(positive_theta) CALL abort_acc("positive_theta") 361 402 IF(positive_theta) CALL copy_q_to_theta(f_theta_rhodz,f_rhodz,f_q) 362 403 END IF 363 404 CALL exit_profile(id_adv) 405 ! CALL checksum(f_ps) 406 ! CALL checksum(f_theta_rhodz) 407 ! CALL checksum(f_u) 408 ! CALL checksum(f_q) 364 409 365 410 CALL enter_profile(id_diags)
Note: See TracChangeset
for help on using the changeset viewer.