Changeset 595


Ignore:
Timestamp:
10/19/17 10:32:52 (6 years ago)
Author:
dubos
Message:

devel : fix halo issues with computation of energy fluxes

Location:
codes/icosagcm/devel/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/diagnostics/diagflux.F90

    r594 r595  
    150150    INTEGER :: ij, l, ij_omp_begin_ext, ij_omp_end_ext 
    151151    Rd = kappa*cpp 
    152     CALL distrib_level(ij_end_ext-ij_begin_ext+1,ij_omp_begin_ext,ij_omp_end_ext) 
    153     ij_omp_begin_ext = ij_omp_begin_ext+ij_begin_ext-1 
    154     ij_omp_end_ext = ij_omp_end_ext+ij_begin_ext-1 
     152    ! even if loops are of the _ext variant, we still need halo exchanges before reconstructing fluxes at cell centers 
     153    ! => loop over interior region 
     154    CALL distrib_level(ij_end-ij_begin+1,ij_omp_begin_ext,ij_omp_end_ext) 
     155    ij_omp_begin_ext = ij_omp_begin_ext+ij_begin-1 
     156    ij_omp_end_ext = ij_omp_end_ext+ij_begin-1 
    155157#include "../kernels/energy_fluxes.k90" 
    156158  END SUBROUTINE compute_diagflux_energy 
  • codes/icosagcm/devel/src/diagnostics/observable.f90

    r594 r595  
    167167          CALL output_field("massflux_lon",f_buf_ulon) 
    168168          CALL output_field("massflux_lat",f_buf_ulat) 
     169 
     170          CALL transfert_request(f_epotfluxt,req_e1_vect)  
    169171          CALL flux_centered_lonlat(1./(itau_out*dt) , f_epotfluxt, f_buf_ulon, f_buf_ulat) 
    170172          CALL output_field("epot_t", f_epot) 
    171173          CALL output_field("epotflux_lon",f_buf_ulon) 
    172174          CALL output_field("epotflux_lat",f_buf_ulat) 
     175 
     176          CALL transfert_request(f_ekinfluxt,req_e1_vect)  
    173177          CALL flux_centered_lonlat(1./(itau_out*dt) , f_ekinfluxt, f_buf_ulon, f_buf_ulat) 
    174178          CALL output_field("ekin_t", f_ekin) 
    175179          CALL output_field("ekinflux_lon",f_buf_ulon) 
    176180          CALL output_field("ekinflux_lat",f_buf_ulat) 
     181 
     182          CALL transfert_request(f_enthalpyfluxt,req_e1_vect)  
    177183          CALL flux_centered_lonlat(1./(itau_out*dt) , f_enthalpyfluxt, f_buf_ulon, f_buf_ulat) 
    178184          CALL output_field("enthalpy_t", f_enthalpy) 
    179185          CALL output_field("enthalpyflux_lon",f_buf_ulon) 
    180186          CALL output_field("enthalpyflux_lat",f_buf_ulat) 
     187 
    181188          CALL qflux_centered_lonlat(1./(itau_out*dt) , f_qfluxt, f_qfluxt_lon, f_qfluxt_lat) 
    182189          CALL output_field("qmass_t", f_qmasst) 
  • codes/icosagcm/devel/src/time/timeloop_gcm.f90

    r594 r595  
    304304        
    305305       IF(MOD(it,itau_adv)==0) THEN 
    306           IF(diagflux_on) CALL diagflux_energy(adv_over_out, f_phis,f_rhodz,f_theta_rhodz,f_u, f_geopot,f_theta, f_hfluxt) 
    307306          CALL advect_tracer(f_hfluxt,f_wfluxt,f_u, f_q,f_rhodz, & ! update q and rhodz after RK step 
    308307               adv_over_out, f_masst,f_qmasst,f_massfluxt, f_qfluxt)  ! accumulate mass and fluxes if diagflux_on 
    309308          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 
    310313          IF (check_rhodz) THEN ! check that rhodz is consistent with ps 
    311314             DO ind=1,ndomain 
Note: See TracChangeset for help on using the changeset viewer.