Ignore:
Timestamp:
Jul 21, 2017, 4:07:38 PM (7 years ago)
Author:
mlefevre
Message:

Add of Venus mesoscale structure + update of Venus LES

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F.new

    r1636 r1724  
    4040        isfflx, diff_opt, km_opt, &
    4141        HISTORY_INTERVAL, &
    42         HR_SW,HR_LW,SWDOWNZ,&
     42        HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,SWDOWNZ,&
    4343        TAU_DUST,RDUST,QSURFDUST,&
    4444        MTOT,ICETOT,VMR_ICE,TAU_ICE,RICE,&
     
    109109REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(OUT ) :: &
    110110     RTHBLTEN,RUBLTEN,RVBLTEN, &
    111      HR_SW,HR_LW,RDUST,VMR_ICE,RICE
     111     HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,RDUST,VMR_ICE,RICE
    112112REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: &
    113113     M_Q2
     
    138138   ! ------> inputs:
    139139   INTEGER :: ngrid,nlayer,nq,nsoil
    140    REAL :: pday,ptime,MY 
     140   REAL*8 :: pday,ptime
     141   REAL :: MY 
    141142   REAL :: phisfi_val
    142143   LOGICAL :: firstcall,lastcall
    143144   ! ----------
    144    REAL,DIMENSION(:,:),ALLOCATABLE :: pplev,pplay,pphi,pu,pv,pt,flxw
    145    REAL,DIMENSION(:,:,:),ALLOCATABLE :: pq 
     145   REAL*8,DIMENSION(:,:),ALLOCATABLE :: pplev,pplay,pphi,pu,pv,pt,flxw
     146   REAL*8,DIMENSION(:,:,:),ALLOCATABLE :: pq 
    146147
    147148   ! <------ outputs:
    148149   !     physical tendencies
    149    REAL,DIMENSION(:),ALLOCATABLE :: pdpsrf
    150    REAL,DIMENSION(:,:),ALLOCATABLE :: pdu,pdv,pdt
    151    REAL,DIMENSION(:,:,:),ALLOCATABLE :: pdq
     150   REAL*8,DIMENSION(:),ALLOCATABLE :: pdpsrf
     151   REAL*8,DIMENSION(:,:),ALLOCATABLE :: pdu,pdv,pdt,pdtheta
     152   REAL*8,DIMENSION(:,:,:),ALLOCATABLE :: pdq
    152153   ! ... intermediate arrays
    153154   REAL, DIMENSION(:), ALLOCATABLE  :: &
     
    158159   ! Additional control variables
    159160   INTEGER :: sponge_top,relax,ips,ipe,jps,jpe,kps,kpe
    160    REAL :: elaps, ptimestep
     161   REAL :: elaps
     162   REAL*8 :: ptimestep
    161163   INTEGER :: test
    162164   REAL :: wappel_phys
     
    173175             dp_save
    174176      REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: &
    175              du_save, dv_save, dt_save
     177             du_save, dv_save, dt_save,dtheta_save
    176178      REAL, DIMENSION(:,:,:,:), ALLOCATABLE, SAVE :: &
    177179             dq_save     
     
    180182             dp_save
    181183      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
    182              du_save, dv_save, dt_save
     184             du_save, dv_save, dt_save,dtheta_save
    183185      REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: &
    184186             dq_save     
     
    191193
    192194   !! arguments to physiq
    193    REAL,ALLOCATABLE :: zpk_omp(:,:)
    194    REAL,ALLOCATABLE :: zphis_omp(:) ! surface geopotential
    195    REAL,ALLOCATABLE :: presnivs_omp(:) ! approximate pressure of atm. layers 
    196    REAL,ALLOCATABLE :: zrfi_omp(:,:) ! relative wind vorticity, in s-1
    197 
     195   CHARACTER(len=20),ALLOCATABLE :: tname(:) ! tracer names
     196   REAL*8,ALLOCATABLE :: zpk_omp(:,:)
     197   REAL*8,ALLOCATABLE :: zphis_omp(:) ! surface geopotential
     198   REAL*8,ALLOCATABLE :: presnivs_omp(:) ! approximate pressure of atm. layers 
     199   REAL*8,ALLOCATABLE :: zrfi_omp(:,:) ! relative wind vorticity, in s-1
     200   REAL :: tk1,tk2
    198201!==================================================================
    199202! CODE
     
    301304   ALLOCATE(dv_save(ngrid,nlayer,max_dom))
    302305   ALLOCATE(dt_save(ngrid,nlayer,max_dom))
     306   ALLOCATE(dtheta_save(ngrid,nlayer,max_dom))
    303307   ALLOCATE(dq_save(ngrid,nlayer,nq,max_dom))
    304308   dp_save(:,:)=0.    !! initialize these arrays ...
     
    306310   dv_save(:,:,:)=0.
    307311   dt_save(:,:,:)=0.
     312   dtheta_save(:,:,:)=0.
    308313   dq_save(:,:,:,:)=0.
    309314ENDIF
     
    319324ALLOCATE(dv_save(ngrid,nlayer))
    320325ALLOCATE(dt_save(ngrid,nlayer))
     326ALLOCATE(dtheta_save(ngrid,nlayer))
    321327ALLOCATE(dq_save(ngrid,nlayer,nq))
    322328ENDIF
     
    325331dv_save(:,:)=0.
    326332dt_save(:,:)=0.
     333dtheta_save(:,:)=0.
    327334dq_save(:,:,:)=0.
    328335flag_first_restart=.false.
     
    369376! ALLOCATE !
    370377!----------!
     378IF (.not.ALLOCATED(tname)) ALLOCATE(tname(nq))
    371379!-------------------------------------------------------------------------------!
    372380! outputs:                                                                      !       
     
    381389ALLOCATE(pdv(ngrid,nlayer))
    382390ALLOCATE(pdt(ngrid,nlayer))
     391ALLOCATE(pdtheta(ngrid,nlayer))
    383392ALLOCATE(pdq(ngrid,nlayer,nq))
    384393!!!
     
    392401pdv(:,:)=dv_save(:,:,id)
    393402pdt(:,:)=dt_save(:,:,id)
     403pdtheta(:,:)=dtheta_save(:,:,id)
    394404pdq(:,:,:)=dq_save(:,:,:,id)
    395405#else
     406print*,'else'
    396407pdpsrf(:)=dp_save(:)
    397408pdu(:,:)=du_save(:,:)
    398409pdv(:,:)=dv_save(:,:)
    399410pdt(:,:)=dt_save(:,:)
     411pdtheta(:,:)=dtheta_save(:,:)
    400412pdq(:,:,:)=dq_save(:,:,:)
    401413#endif
     
    442454  !! tracers' name
    443455  PRINT *,'** ',planet_type,'** TRACERS NAMES'
    444   CALL update_inputs_physiq_tracers(nq,MARS_MODE)
     456  CALL update_inputs_physiq_tracers(nq,MARS_MODE,tname)
    445457  !! PHYSICS VARIABLES (cf. iniphysiq in LMD GCM)
    446458  !! parameters are defined in the module_model_constants.F WRF routine
     
    504516  ENDIF
    505517ENDIF
    506 
    507 IF (MARS_MODE .EQ. 32) THEN
    508   IF (firstcall .EQV. .true. .and. (.not. restart)) THEN
    509       q_prof(:,7) = 0.95
    510 !! traceurs(7)   = 'co2'
    511   ENDIF
    512 ENDIF
    513 
    514518
    515519IF (firstcall .EQV. .true.) THEN
     
    621625            M_ALBEDO,CST_AL,&
    622626            M_TSURF,M_EMISS,M_CO2ICE,&
    623             M_GW,M_Z0,CST_Z0,&
     627            M_GW,M_Z0,&
    624628            M_H2OICE,&
    625629            phisfi_val)
     
    653657pdv(:,:)=0.
    654658pdt(:,:)=0.
     659pdtheta(:,:)=0.
    655660pdq(:,:,:)=0.
    656661print *, '** ',planet_type,'** CALL TO LMD PHYSICS'
     
    662667            ptime,pday,MY)
    663668!!!
    664 CALL call_physiq(planet_type,ngrid,nlayer,nq,      &
     669CALL call_physiq(planet_type,ngrid,nlayer,nq,tname, &
    665670                       firstcall,lastcall,          &
    666671                       pday,ptime,ptimestep,        &
     
    679684ENDIF
    680685#endif
     686
     687IF (planet_type .eq. "venus" ) THEN
     688  DO j=jps,jpe
     689  DO i=ips,ipe
     690    do k=kps,kpe
     691      subs=(j-jps)*(ipe-ips+1)+(i-ips+1)
     692      tk1=(pt(subs,k)**nu + nu*TT00**nu*log((p1000mb/pplay(subs,k))**rcp))**(1/nu)
     693      tk2=((pt(subs,k) + pdt(subs,k))**nu + nu*TT00**nu*log((p1000mb/pplay(subs,k))**rcp))**(1/nu)
     694      pdtheta(subs,k)=tk2-tk1
     695    enddo
     696  ENDDO
     697  ENDDO
     698ENDIF
    681699
    682700print *, '** ',planet_type,'** CALL TO LMD PHYSICS DONE'
     
    694712DEALLOCATE(zrfi_omp)
    695713
    696 
    697714!---------------------------------------------------------------------------------!
    698715! PHYSIQ TENDENCIES ARE SAVED TO BE SPLIT WITHIN INTERMEDIATE DYNAMICAL TIMESTEPS !
     
    703720dv_save(:,:,id)=pdv(:,:)
    704721dt_save(:,:,id)=pdt(:,:)
     722dtheta_save(:,:,id)=pdtheta(:,:)
    705723dq_save(:,:,:,id)=pdq(:,:,:)
    706724#else
     
    709727dv_save(:,:)=pdv(:,:)
    710728dt_save(:,:)=pdt(:,:)
     729dtheta_save(:,:)=pdtheta(:,:)
    711730dq_save(:,:,:)=pdq(:,:,:)
    712731#endif
     
    737756CALL update_outputs_physiq_turb( &
    738757            ims,ime,jms,jme,kms,kme,&
    739             ips,ipe,jps,jpe,&
     758            ips,ipe,jps,jpe,kps,kpe,&
    740759            M_Q2,M_WSTAR,&
    741760            HFMAX,ZMAX,USTM,HFX)
     
    746765            SWDOWNZ,TAU_DUST,QSURFDUST,&
    747766            MTOT,ICETOT,TAU_ICE,&
    748             HR_SW,HR_LW,&
     767            HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,&
    749768            RDUST,VMR_ICE,RICE)
    750769!!!
     770print*,"update_outputs_physiq_diag"
     771
     772
    751773ENDIF call_physics
    752774
     
    770792! --is the one calculated during the last call to physics          !
    771793!------------------------------------------------------------------!
    772 
     794!print*,'pdt',pdt(1,1),pdt(1,nlayer)
     795!print*,'exner',exner(1,:,1)
    773796DO j = jps,jpe
    774797DO i = ips,ipe
     
    778801    ! zonal wind
    779802  RUBLTEN(i,kps:kpe,j) = pdu(subs,kps:kpe)
    780 
    781803    ! meridional wind
    782804  RVBLTEN(i,kps:kpe,j) = pdv(subs,kps:kpe)
    783 
    784805    ! potential temperature
    785806    ! (dT = dtheta * exner for isobaric coordinates or if pressure variations are negligible)
    786   RTHBLTEN(i,kps:kpe,j) = pdt(subs,kps:kpe) / exner(i,kps:kpe,j)
    787 
     807  IF (planet_type .eq. "venus" ) THEN
     808    RTHBLTEN(i,kps:kpe,j) = pdtheta(subs,kps:kpe)
     809  ELSE
     810   RTHBLTEN(i,kps:kpe,j) = pdt(subs,kps:kpe) / exner(i,kps:kpe,j)
     811  ENDIF
    788812    ! update surface pressure (cf CO2 cycle in physics)
    789813    ! here dt is needed
    790814  PSFC(i,j)=PSFC(i,j)+pdpsrf(subs)*dt
    791 
    792815    ! tracers
    793816  SCALAR(i,kps:kpe,j,1)=0.
     
    807830ENDDO
    808831ENDDO
    809 
    810832DEALLOCATE(pdpsrf)
    811833DEALLOCATE(pdu)
     
    813835DEALLOCATE(pdt)
    814836DEALLOCATE(pdq)
    815 
     837DEALLOCATE(pdtheta)
    816838!!*****!!
    817839!! END !!
Note: See TracChangeset for help on using the changeset viewer.