Changeset 3961


Ignore:
Timestamp:
Nov 7, 2016, 1:56:00 PM (8 years ago)
Author:
ymipsl
Message:

Bugs fix in interface dynamic-physic.

  • Mass flux expected by LMDZ physics is not divided by cell area (not really a flux ?).
  • Geopotential expected by LMDZ physics is not absolute but related to phis : phi_lmdz = phi-phis

YM

File:
1 edited

Legend:

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

    r3902 r3961  
    9999    CALL allocate_field(f_bounds_lon,field_t,type_real,6)
    100100    CALL allocate_field(f_bounds_lat,field_t,type_real,6)
    101     CALL allocate_field(f_p,field_t,type_real,llm+1)
     101    CALL allocate_field(f_p,field_t,type_real,llm+1,name="p_in")
    102102    CALL allocate_field(f_pks,field_t,type_real)
    103103    CALL allocate_field(f_pk,field_t,type_real,llm)
    104     CALL allocate_field(f_p_layer,field_t,type_real,llm)
     104    CALL allocate_field(f_p_layer,field_t,type_real,llm,name="p_layer_in")
    105105    CALL allocate_field(f_theta,field_t,type_real,llm)
    106     CALL allocate_field(f_phi,field_t,type_real,llm)
    107     CALL allocate_field(f_Temp,field_t,type_real,llm)
    108     CALL allocate_field(f_ulon,field_t,type_real,llm)
    109     CALL allocate_field(f_ulat,field_t,type_real,llm)
    110     CALL allocate_field(f_dulon,field_t,type_real,llm)
    111     CALL allocate_field(f_dulat,field_t,type_real,llm)
    112     CALL allocate_field(f_dTemp,field_t,type_real,llm)
    113     CALL allocate_field(f_dq,field_t,type_real,llm,nqtot)
    114     CALL allocate_field(f_dps,field_t,type_real)
     106    CALL allocate_field(f_phi,field_t,type_real,llm,name="phi_in")
     107    CALL allocate_field(f_Temp,field_t,type_real,llm,name="Temp_in")
     108    CALL allocate_field(f_ulon,field_t,type_real,llm,name="ulon_in")
     109    CALL allocate_field(f_ulat,field_t,type_real,llm,name="ulat_in")
     110    CALL allocate_field(f_dulon,field_t,type_real,llm,name="dulon_out")
     111    CALL allocate_field(f_dulat,field_t,type_real,llm,name="dulat_out")
     112    CALL allocate_field(f_dTemp,field_t,type_real,llm,name="dTemp_out")
     113    CALL allocate_field(f_dq,field_t,type_real,llm,nqtot,name="dq_out")
     114    CALL allocate_field(f_dps,field_t,type_real,name="dps_out")
    115115    CALL allocate_field(f_duc,field_t,type_real,3,llm)   
    116116
     
    347347
    348348  SUBROUTINE physics
    349   USE ICOSA
     349  USE icosa
    350350  USE time_mod
    351351  USE disvert_mod
     
    357357  USE distrib_icosa_lmdz_mod, ONLY : transfer_icosa_to_lmdz, transfer_lmdz_to_icosa
    358358  USE physics_external_mod, ONLY : it, f_phis, f_ps, f_theta_rhodz, f_u, f_wflux, f_q
     359  USE write_field_mod
     360  USE checksum_mod
    359361! from LMDZ
    360362  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
     363  USE geometry_mod, ONLY : cell_area
    361364  IMPLICIT NONE
    362365 
    363366    REAL(rstd),POINTER :: phis(:)
    364367    REAL(rstd),POINTER :: ps(:)
    365     REAL(rstd),POINTER :: theta_rhodz(:,:)
     368    REAL(rstd),POINTER :: theta_rhodz(:,:,:)
    366369    REAL(rstd),POINTER :: u(:,:)
    367370    REAL(rstd),POINTER :: wflux(:,:)
     
    384387
    385388
    386     INTEGER :: ind
     389    INTEGER :: ind,l
    387390   
    388391    REAL(rstd),ALLOCATABLE,SAVE :: ps_phy(:)
     
    502505
    503506
     507!    CALL writeField("p_in",f_p)
     508!    CALL writeField("p_layer_in",f_p_layer)
     509!    CALL writeField("phi_in",f_phi)
     510!    CALL writeField("phis_in",f_phis)
     511!    CALL writeField("ulon_in",f_ulon)
     512!    CALL writeField("ulat_in",f_ulat)
     513!    CALL writeField("Temp_in",f_Temp)
     514!    CALL writeField("q_in",f_q)
     515!    CALL writeField("wflux_in",f_wflux)
     516
     517!    CALL checksum(f_p)
     518!    CALL checksum(f_p_layer)
     519!    CALL checksum(f_phi)
     520!    CALL checksum(f_phis)
     521!    CALL checksum(f_ulon)
     522!    CALL checksum(f_ulat)
     523!    CALL checksum(f_Temp)
     524!    CALL checksum(f_q)
     525!    CALL checksum(f_wflux)
    504526
    505527    CALL transfer_icosa_to_lmdz(f_p      , p_phy)
     
    513535    CALL transfer_icosa_to_lmdz(f_wflux  , wflux_phy)
    514536
     537    DO l=1,llm
     538      wflux_phy(:,l)=wflux_phy(:,l)*cell_area(:)
     539      phi_phy(:,l)=phi_phy(:,l)-phis_phy(:)
     540    ENDDO
     541   
    515542    CALL wxios_set_context()
    516543 
     
    524551    CALL transfer_lmdz_to_icosa(dq_phy   , f_dq )
    525552    CALL transfer_lmdz_to_icosa(dps_phy  , f_dps )
     553 
     554!    CALL writeField("dulon_out",f_dulon)
     555!    CALL writeField("dulat_out",f_dulat)
     556!    CALL writeField("dTemp_out",f_dTemp)
     557!    CALL writeField("dq_out",f_dq)
     558!    CALL writeField("dps_out",f_dps)
     559
     560!    CALL checksum(f_dulon)
     561!    CALL checksum(f_dulat)
     562!    CALL checksum(f_dTemp)
     563!    CALL checksum(f_dq)
     564!    CALL checksum(f_dps)
    526565   
    527566    CALL send_message(f_dps,req_dps0)
     
    631670        DO i=ii_begin,ii_end
    632671          ij=(j-1)*iim+i
    633           theta(ij,l) = theta_rhodz(ij,l) / ((p(ij,l)-p(ij,l+1))/g)
     672          theta(ij,l) = theta_rhodz(ij,l,1) / ((p(ij,l)-p(ij,l+1))/g)
    634673          Temp(ij,l) = theta(ij,l) * pk(ij,l) / cpp
    635674          p_layer(ij,l)=preff*(pk(ij,l)/cpp)**(1./kappa)
     
    803842        DO i=ii_begin,ii_end
    804843          ij=(j-1)*iim+i
    805           theta_rhodz(ij,l) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / (pk(ij,l) / cpp )
     844          theta_rhodz(ij,l,1) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / (pk(ij,l) / cpp )
    806845        ENDDO
    807846      ENDDO
Note: See TracChangeset for help on using the changeset viewer.