Changeset 4132


Ignore:
Timestamp:
Feb 25, 2019, 5:05:00 PM (6 years ago)
Author:
ymipsl
Message:

Add rotationnal computation sent to LMDZ physics through the interface.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/ICOSA_LMDZ/src/phylmd/interface_icosa_lmdz.f90

    r4122 r4132  
    55 
    66 
    7   TYPE(t_message),SAVE :: req_u
     7  TYPE(t_message),SAVE :: req_u, req_z
    88  TYPE(t_message),SAVE :: req_dps0, req_dulon0, req_dulat0, req_dTemp0, req_dq0
    99
     
    1717  TYPE(t_field),POINTER,SAVE :: f_ulon(:)   
    1818  TYPE(t_field),POINTER,SAVE :: f_ulat(:)   
     19  TYPE(t_field),POINTER,SAVE :: f_vort(:)   
     20  TYPE(t_field),POINTER,SAVE :: f_vortc(:)   
    1921  TYPE(t_field),POINTER,SAVE :: f_dulon(:)
    2022  TYPE(t_field),POINTER,SAVE :: f_dulat(:)
     
    8183    CALL allocate_field(f_ulon,field_t,type_real,llm,name="ulon_in")
    8284    CALL allocate_field(f_ulat,field_t,type_real,llm,name="ulat_in")
     85    CALL allocate_field(f_vort,field_z,type_real,llm,name="vort_in")
     86    CALL allocate_field(f_vortc,field_t,type_real,llm,name="vortc_in")
    8387    CALL allocate_field(f_dulon,field_t,type_real,llm,name="dulon_out")
    8488    CALL allocate_field(f_dulat,field_t,type_real,llm,name="dulat_out")
     
    423427  USE write_field_mod
    424428  USE checksum_mod
     429  USE vorticity_mod
     430
    425431! from LMDZ
    426432  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
     
    444450    REAL(rstd),POINTER :: ulon(:,:)
    445451    REAL(rstd),POINTER :: ulat(:,:)
     452    REAL(rstd),POINTER :: vort(:,:)
     453    REAL(rstd),POINTER :: vortc(:,:)
    446454    REAL(rstd),POINTER :: dulon(:,:)
    447455    REAL(rstd),POINTER :: dulat(:,:)
     
    509517      first=.FALSE.
    510518      CALL init_message(f_u,req_e1_vect,req_u)
     519      CALL init_message(f_vort,req_z1_scal,req_z)
    511520      ALLOCATE(ps_phy(klon_omp))
    512521      ALLOCATE(p_phy(klon_omp,llm+1))
     
    538547   
    539548    CALL transfert_message(f_u,req_u)
     549    DO ind=1,ndomain
     550      IF (assigned_domain(ind)) THEN
     551        CALL swap_dimensions(ind)
     552        CALL swap_geometry(ind)
     553        u=f_u(ind)
     554        vort=f_vort(ind)
     555        CALL compute_vorticity(u,vort)
     556      ENDIF
     557    ENDDO
     558
     559    CALL transfert_message(f_vort,req_z)
     560
    540561   
    541562    DO ind=1,ndomain
     
    559580        ulon=f_ulon(ind)
    560581        ulat=f_ulat(ind)
     582        vort=f_vort(ind)
     583        vortc=f_vortc(ind)
    561584           
    562585        CALL grid_icosa_to_physics
     
    582605!    CALL writeField("q_in",f_q)
    583606!    CALL writeField("wflux_in",f_wflux)
     607!     CALL writeField("vortc",f_vortc)
    584608
    585609!    CALL checksum(f_p)
     
    599623    CALL transfer_icosa_to_lmdz(f_ulon   , ulon_phy )
    600624    CALL transfer_icosa_to_lmdz(f_ulat   , ulat_phy)
     625    CALL transfer_icosa_to_lmdz(f_vortc   , rot_phy)
    601626    CALL transfer_icosa_to_lmdz(f_Temp   , Temp_phy)
    602627    CALL transfer_icosa_to_lmdz(f_q      , q_phy)
     
    611636 
    612637    ! Ehouarn: rot_phy() not implemented!! Set it to zero for now
    613     rot_phy(:,:)=0
     638!    rot_phy(:,:)=0
    614639    CALL physiq(klon_omp, llm, debut, lafin, dtphy, &
    615640                p_phy, p_layer_phy, phi_phy, phis_phy, presnivs, &
     
    698723    REAL(rstd) :: uc(3)
    699724    INTEGER :: i,j,ij,l
    700    
    701725
    702726! compute pression
     
    809833    ENDDO
    810834
     835
     836! compute centered vorticity
     837   
     838    DO l=ll_begin,ll_end
     839      DO j=jj_begin,jj_end
     840        DO i=ii_begin,ii_end
     841          ij=(j-1)*iim+i
     842          vortc(ij,l) =  Riv(ij,vup)    * vort(ij+z_up,l)    + &
     843                         Riv(ij,vlup)  * vort(ij+z_lup,l)   + &
     844                         Riv(ij,vldown)* vort(ij+z_ldown,l) + &
     845                         Riv(ij,vdown) * vort(ij+z_down,l)  + &
     846                         Riv(ij,vrdown)* vort(ij+z_rdown,l) + &
     847                         Riv(ij,vrup)  * vort(ij+z_rup,l)
     848      ENDDO
     849    ENDDO
     850  ENDDO
     851
     852
     853
    811854!$OMP BARRIER
    812855    END SUBROUTINE grid_icosa_to_physics
Note: See TracChangeset for help on using the changeset viewer.