Ignore:
Timestamp:
02/28/20 10:18:33 (4 years ago)
Author:
ymipsl
Message:

1j+1j=2j

  • the iteration frequency of syncronization procedure at frontier (every 10 time step before) must be a sub multiple of the restart period (daily). So we fix itau_sync to be close of 10 and be a sub multiple of number of iteration in a day.
  • The value of rhodz for advection must be recomputed at a sub-multiple multiple of the restart period, so for now we decide to recomputing it each time at the end of the advection.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/trunk/src/time/timeloop_gcm.F90

    r962 r1015  
    1111  PRIVATE 
    1212   
    13   INTEGER, PARAMETER :: itau_sync=10 
     13  INTEGER, PARAMETER :: sync_it=10 
    1414  TYPE(t_message),SAVE :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0, req_W0, req_geopot0 
    1515  LOGICAL, SAVE :: positive_theta 
     
    203203    LOGICAL, PARAMETER :: check_rhodz=.FALSE. 
    204204    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     
    205208    LOGICAL,SAVE :: first_physic=.TRUE. 
    206209    !$OMP THREADPRIVATE(first_physic)     
    207210 
     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       
    208217    CALL switch_omp_distrib_level 
    209218    CALL caldyn_BC(f_phis, f_geopot, f_wflux) ! set constant values in first/last interfaces 
     
    261270 
    262271    DO it=itau0+1,itau0+itaumax 
     272 
    263273       CALL print_iteration(it, itau0, itaumax, start_clock, rate_clock) 
    264274 
     
    272282       END IF 
    273283 
    274        IF (it==itau0+1 .OR. MOD(it,itau_sync)==0) THEN 
     284       IF (it==itau0+1 .OR. MOD(it-1,itau_sync)==0) THEN 
    275285          CALL send_message(f_ps,req_ps0) 
    276286          CALL wait_message(req_ps0) 
     
    291301       ENDIF 
    292302 
     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 
    293312       CALL guided(it*dt,f_ps,f_theta_rhodz,f_u,f_q) 
    294313 
     
    302321       END SELECT 
    303322       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) 
    304332 
    305333       CALL enter_profile(id_dissip) 
     
    338366       END IF 
    339367       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) 
    340376 
    341377       CALL enter_profile(id_adv) 
     
    349385          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) 
    350386 
    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 
    360401          IF(positive_theta) CALL abort_acc("positive_theta") 
    361402          IF(positive_theta) CALL copy_q_to_theta(f_theta_rhodz,f_rhodz,f_q) 
    362403       END IF 
    363404       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) 
    364409 
    365410       CALL enter_profile(id_diags) 
Note: See TracChangeset for help on using the changeset viewer.