Ignore:
Timestamp:
10/19/17 17:04:26 (7 years ago)
Author:
dubos
Message:

trunk : backported commits r582-r598 (transport diagnostics)

File:
1 edited

Legend:

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

    r581 r599  
    168168    USE caldyn_mod 
    169169    USE advect_tracer_mod 
     170    USE diagflux_mod 
    170171    USE physics_mod 
    171172    USE mpipara 
     
    181182    REAL(rstd),POINTER :: rhodz(:,:), mass(:,:), ps(:) 
    182183 
    183     INTEGER :: ind 
    184     INTEGER :: it,i,j,l,n,  stage 
    185     LOGICAL :: fluxt_zero(ndomain) ! set to .TRUE. to start accumulating fluxes in time 
     184    REAL(rstd) :: adv_over_out ! ratio itau_adv/itau_out 
     185    INTEGER :: ind, it,i,j,l,n,  stage 
     186    LOGICAL :: fluxt_zero(ndomain) ! set to .TRUE. to start accumulating mass fluxes in time 
    186187    LOGICAL, PARAMETER :: check_rhodz=.FALSE. 
    187188    INTEGER :: start_clock, stop_clock, rate_clock 
     
    210211 
    211212    IF(positive_theta) CALL copy_theta_to_q(f_theta_rhodz,f_rhodz,f_q) 
     213    IF(diagflux_on) THEN 
     214       adv_over_out = itau_adv*(1./itau_out) 
     215    ELSE 
     216       adv_over_out = 0. 
     217    END IF 
    212218 
    213219    CALL check_conserve(f_ps,f_dps,f_u,f_theta_rhodz,f_phis,itau0)   
    214220 
    215     CALL trace_on 
     221    Call trace_on 
    216222 
    217223    IF (xios_output) THEN ! we must call update_calendar before any XIOS output 
     
    267273          CALL HEVI_scheme(it, fluxt_zero) 
    268274       END SELECT 
    269         
     275 
    270276       IF (MOD(it,itau_dissip)==0) THEN 
    271277           
     
    298304        
    299305       IF(MOD(it,itau_adv)==0) THEN 
    300           CALL advect_tracer(f_hfluxt,f_wfluxt,f_u, f_q,f_rhodz)  ! update q and rhodz after RK step 
    301           fluxt_zero=.TRUE. 
    302           ! FIXME : check that rhodz is consistent with ps 
    303           IF (check_rhodz) THEN 
     306          CALL advect_tracer(f_hfluxt,f_wfluxt,f_u, f_q,f_rhodz, & ! update q and rhodz after RK step 
     307               adv_over_out, f_masst,f_qmasst,f_massfluxt, f_qfluxt)  ! accumulate mass and fluxes if diagflux_on 
     308          fluxt_zero=.TRUE. ! restart accumulation of hfluxt and qfluxt at next call to explicit_scheme / HEVI_scheme 
     309          ! At this point advect_tracer has obtained the halos of u and rhodz, 
     310          ! needed for correct computation of kinetic energy 
     311          IF(diagflux_on) CALL diagflux_energy(adv_over_out, f_phis,f_rhodz,f_theta_rhodz,f_u, f_geopot,f_theta, f_hfluxt) 
     312 
     313          IF (check_rhodz) THEN ! check that rhodz is consistent with ps 
    304314             DO ind=1,ndomain 
    305315                IF (.NOT. assigned_domain(ind)) CYCLE 
Note: See TracChangeset for help on using the changeset viewer.