Changeset 472 for codes/icosagcm/trunk


Ignore:
Timestamp:
09/05/16 14:59:46 (8 years ago)
Author:
ymipsl
Message:

Repairing openMP :
physic_column and physic_dcmip2016 seems OK. Only for thread assigned to domain.

YM

Location:
codes/icosagcm/trunk/src
Files:
4 edited

Legend:

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

    r467 r472  
    5151    CALL output_field_init 
    5252    CALL init_timeloop 
    53   !$OMP END PARALLEL 
    54   
    5553    CALL init_physics 
    5654    
    57   !$OMP PARALLEL   
    5855    CALL timeloop 
    5956    CALL switch_omp_no_distrib_level 
  • codes/icosagcm/trunk/src/physics.f90

    r402 r472  
    6363       CALL allocate_field(f_dulat,field_t,type_real,llm, name='dulat') 
    6464       CALL allocate_field(f_temp,field_t,type_real,llm, name='temp') 
    65        CALL allocate_field(f_temp,field_t,type_real,llm, name='temp') 
    6665       CALL init_pack_before ! Compute physics_inout%ngrid and offsets used by pack/unpack 
    6766       CALL init_physics_dcmip2016 
  • codes/icosagcm/trunk/src/physics_dcmip2016.f90

    r435 r472  
    66!$OMP THREADPRIVATE(testcase) 
    77 
    8   TYPE(t_field),POINTER :: f_out_i(:) 
    9   REAL(rstd),POINTER :: out_i(:,:) 
    10  
    11   TYPE(t_field),POINTER  :: f_precl(:) 
    12   REAL(rstd),ALLOCATABLE :: precl_packed(:) 
    13  
    14   TYPE(t_field),POINTER  :: f_Q1(:) 
    15   TYPE(t_field),POINTER  :: f_Q2(:) 
    16   TYPE(t_field),POINTER  :: f_PS(:) 
    17   TYPE(t_field),POINTER  :: f_rhodz(:) 
    18   TYPE(t_field),POINTER  :: f_Q1_col_int(:) 
    19   TYPE(t_field),POINTER  :: f_Q2_col_int(:) 
     8  TYPE(t_field),SAVE,POINTER :: f_out_i(:) 
     9  REAL(rstd),SAVE,POINTER :: out_i(:,:) 
     10 
     11  TYPE(t_field),SAVE,POINTER  :: f_precl(:) 
     12  REAL(rstd),SAVE,ALLOCATABLE :: precl_packed(:) 
     13!$OMP THREADPRIVATE(precl_packed)   
     14 
     15  TYPE(t_field),SAVE,POINTER  :: f_Q1(:) 
     16  TYPE(t_field),SAVE,POINTER  :: f_Q2(:) 
     17  TYPE(t_field),SAVE,POINTER  :: f_PS(:) 
     18  TYPE(t_field),SAVE,POINTER  :: f_rhodz(:) 
     19  TYPE(t_field),SAVE,POINTER  :: f_Q1_col_int(:) 
     20  TYPE(t_field),SAVE,POINTER  :: f_Q2_col_int(:) 
    2021  PUBLIC :: init_physics, full_physics, write_physics 
    2122 
  • codes/icosagcm/trunk/src/physics_interface.f90

    r381 r472  
    2626 
    2727  TYPE(t_physics_inout), SAVE :: physics_inout 
     28!$OMP THREADPRIVATE(physics_inout)  
    2829  
    2930! pack_info contains indices used by pack/unpack routines 
     
    3940 
    4041  TYPE(t_pack_info), ALLOCATABLE, SAVE :: pack_info(:) 
    41    
     42!$OMP THREADPRIVATE(pack_info) 
     43 
     44 
    4245  INTERFACE pack_field 
    4346     MODULE PROCEDURE pack_2D 
     
    7679    IMPLICIT NONE 
    7780    INTEGER :: ind, offset 
    78     !$OMP MASTER 
     81 
    7982    offset=0 
    8083    ALLOCATE(pack_info(ndomain)) 
    8184    DO ind=1,ndomain 
     85       IF (.NOT. assigned_domain(ind)) CYCLE 
    8286       CALL swap_dimensions(ind) 
    8387       CALL swap_geometry(ind) 
     
    8791    END DO 
    8892    physics_inout%ngrid = offset 
    89     !$OMP END MASTER 
    90     !$OMP BARRIER 
     93 
    9194  END SUBROUTINE init_pack_before 
    9295 
Note: See TracChangeset for help on using the changeset viewer.