Ignore:
Timestamp:
10/31/14 14:52:01 (10 years ago)
Author:
ymipsl
Message:

Merging OpenMP parallisme mode : by subdomain and on vertical level.
This feature is actually experimental but may be retro-compatible with the last method based only on subdomain

YM

File:
1 edited

Legend:

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

    r286 r295  
    1818  SUBROUTINE etat0(f_ps,f_phis,f_theta_rhodz,f_u, f_q) 
    1919  USE icosa 
     20  USE theta2theta_rhodz_mod 
    2021  IMPLICIT NONE 
    2122    TYPE(t_field),POINTER :: f_ps(:) 
     
    2425    TYPE(t_field),POINTER :: f_u(:) 
    2526    TYPE(t_field),POINTER :: f_q(:) 
     27    TYPE(t_field),POINTER,SAVE :: f_temp(:) 
    2628     
    2729    REAL(rstd),POINTER :: ps(:) 
    2830    REAL(rstd),POINTER :: phis(:) 
    2931    REAL(rstd),POINTER :: u(:,:) 
    30     REAL(rstd),POINTER :: theta_rhodz(:,:) 
     32    REAL(rstd),POINTER :: Temp(:,:) 
    3133    REAL(rstd),POINTER :: q(:,:,:) 
    3234 
    3335    INTEGER :: ind 
     36 
     37    CALL allocate_field(f_temp,field_t,type_real,llm,name='temp')  
    3438 
    3539    DO ind=1,ndomain 
     
    4145      phis=f_phis(ind) 
    4246      u=f_u(ind) 
    43       theta_rhodz=f_theta_rhodz(ind) 
    4447      q=f_q(ind) 
    45       CALL compute_etat0_DCMIP3(ps,phis,u,theta_rhodz,q) 
     48      temp=f_temp(ind) 
     49      CALL compute_etat0_DCMIP3(ps,phis,u,Temp,q) 
    4650    ENDDO 
     51 
     52    CALL temperature2theta_rhodz(f_ps,f_temp,f_theta_rhodz) 
     53    CALL deallocate_field(f_temp) 
    4754             
    4855  END SUBROUTINE etat0 
    4956   
    5057 
    51   SUBROUTINE compute_etat0_DCMIP3(ps, phis, u, theta_rhodz,q) 
     58  SUBROUTINE compute_etat0_DCMIP3(ps, phis, u, temp,q) 
    5259  USE icosa 
    5360  USE pression_mod 
     
    6875  REAL(rstd), INTENT(OUT) :: phis(iim*jjm) 
    6976  REAL(rstd), INTENT(OUT) :: u(3*iim*jjm,llm) 
    70   REAL(rstd), INTENT(OUT) :: theta_rhodz(iim*jjm,llm) 
     77  REAL(rstd), INTENT(OUT) :: Temp(iim*jjm,llm) 
    7178  REAL(rstd), INTENT(OUT) :: q(iim*jjm,llm,nqtot) 
    7279   
    7380  REAL(rstd) :: Ts(iim*jjm) 
    7481  REAL(rstd) :: s(iim*jjm) 
    75   REAL(rstd) :: T(iim*jjm,llm) 
    7682  REAL(rstd) :: p(iim*jjm,llm+1) 
    7783  REAL(rstd) :: theta(iim*jjm,llm) 
     
    125131  END DO 
    126132   
     133!$OMP BARRIER 
    127134  CALL compute_pression(ps,p,0) 
     135!$OMP BARRIER 
    128136   
    129137  DO l=1,llm 
     
    134142           IF(use_dcmip_routine) THEN 
    135143              CALL test3_gravity_wave(lon_i(ij),lat_i(ij),pp,dummy,0, & 
    136                    dummy,dummy,dummy,T(ij,l),dummy,dummy,dummy,dummy) 
     144                   dummy,dummy,dummy,Temp(ij,l),dummy,dummy,dummy,dummy) 
    137145           ELSE 
    138146              pspsk=(pp/ps(ij))**kappa 
     
    142150              thetap = dtheta *sin(2*Pi*zz/Lz) * s(ij)                ! perturbation pot. temp. 
    143151              theta(ij,l) = thetab + thetap 
    144               T(ij,l) = theta(ij,l)* ((pp/peq)**kappa) 
     152              Temp(ij,l) = theta(ij,l)* ((pp/peq)**kappa) 
    145153              ! T(ij,l) = Ts(ij)*pspsk / ( Ts(ij) / GG * ( pspsk-1) +1)  ! background temp. 
    146154           END IF 
     
    149157  ENDDO 
    150158   
    151   IF(use_dcmip_routine) THEN 
    152      CALL compute_temperature2theta_rhodz(ps,T,theta_rhodz,0) 
    153   ELSE 
    154      CALL compute_temperature2theta_rhodz(ps,T,theta_rhodz,0) 
    155   END IF 
     159!  IF(use_dcmip_routine) THEN 
     160!     CALL compute_temperature2theta_rhodz(ps,T,theta_rhodz,0) 
     161!  ELSE 
     162!     CALL compute_temperature2theta_rhodz(ps,T,theta_rhodz,0) 
     163!  END IF 
    156164   
    157165  pp=peq 
Note: See TracChangeset for help on using the changeset viewer.