Changeset 579


Ignore:
Timestamp:
10/13/17 15:25:25 (7 years ago)
Author:
dubos
Message:

devel : OpenMP fixes for NH diagnostics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/src/diagnostics/observable.f90

    r533 r579  
    55 
    66  TYPE(t_field),POINTER, SAVE :: f_buf_i(:), & 
    7        f_buf_uh(:), & ! horizontal velocity, different from prognostic velocity if NH 
     7       f_buf_Fel(:), f_buf_uh(:), & ! horizontal velocity, different from prognostic velocity if NH 
    88       f_buf_ulon(:), f_buf_ulat(:), & 
    99       f_buf_u3d(:) ! unused, remove ? 
     
    2828    CALL allocate_field(f_buf_ulat,field_t,type_real,llm, name="buf_ulat") 
    2929    CALL allocate_field(f_buf_uh,  field_u,type_real,llm, name="buf_uh") 
     30    CALL allocate_field(f_buf_Fel, field_u,type_real,llm+1, name="buf_F_el") 
    3031    CALL allocate_field(f_buf_v,   field_z,type_real,llm, name="buf_v") 
    3132    CALL allocate_field(f_buf_s,   field_t,type_real, name="buf_s") 
     
    6061     
    6162    IF(init) THEN 
     63       IF(is_master) PRINT *, 'Creating output files ...' 
    6264       scalar(1)=dt 
    6365       IF (is_omp_master) CALL xios_send_field("timestep", scalar) 
     
    7476 
    7577       CALL output_field("phis",f_phis) 
    76        CALL output_field("Ai",geom%Ai)        
     78       CALL output_field("Ai",geom%Ai)  
     79       IF(is_master) PRINT *, '... done creating output files. Writing initial condition ...' 
    7780    END IF 
    7881 
     
    120123       CALL output_field("geopot_init",f_geopot) 
    121124       CALL output_field("q_init",f_q) 
     125       IF(is_master) PRINT *, 'Done writing initial condition ...' 
    122126    ELSE 
    123127       CALL output_field("uz",f_buf_i) 
     
    165169         f_u(:), f_W(:), f_uz(:), &  ! IN 
    166170         f_uh(:)                         ! OUT 
    167     REAL(rstd),POINTER :: geopot(:,:), ps(:), rhodz(:,:), u(:,:), W(:,:), uh(:,:), uz(:,:) 
     171    REAL(rstd),POINTER :: geopot(:,:), ps(:), rhodz(:,:), u(:,:), W(:,:), uh(:,:), uz(:,:), F_el(:,:) 
    168172    INTEGER :: ind 
    169173     
     
    177181       W = f_W(ind) 
    178182       uh  = f_uh(ind) 
     183       F_el  = f_buf_Fel(ind) 
    179184       IF(caldyn_eta==eta_mass) THEN 
    180185          ps=f_ps(ind) 
     
    182187       END IF 
    183188       uz = f_uz(ind) 
    184        CALL compute_prognostic_vel_to_horiz(geopot,rhodz,u,W,uh,uz) 
     189       !$OMP BARRIER 
     190       CALL compute_prognostic_vel_to_horiz(geopot,rhodz,u,W, F_el, uh,uz) 
     191       !$OMP BARRIER 
    185192    END DO 
    186193  END SUBROUTINE progonostic_vel_to_horiz 
    187194   
    188   SUBROUTINE compute_prognostic_vel_to_horiz(Phi, rhodz, u, W, uh, uz) 
     195  SUBROUTINE compute_prognostic_vel_to_horiz(Phi, rhodz, u, W, F_el, uh, uz) 
    189196    USE omp_para 
    190197    REAL(rstd), INTENT(IN) :: Phi(iim*jjm,llm+1) 
     
    220227       END DO 
    221228 
     229       ! We need a barrier here because we compute F_el above and do a vertical average below 
     230       !$OMP BARRIER 
     231 
    222232       DO l=ll_begin, ll_end ! compute on k levels (full levels) 
    223233          DO ij=ij_begin_ext, ij_end_ext 
Note: See TracChangeset for help on using the changeset viewer.