- Timestamp:
- Jul 21, 2017, 4:07:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F.new
r1636 r1724 40 40 isfflx, diff_opt, km_opt, & 41 41 HISTORY_INTERVAL, & 42 HR_SW,HR_LW, SWDOWNZ,&42 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,SWDOWNZ,& 43 43 TAU_DUST,RDUST,QSURFDUST,& 44 44 MTOT,ICETOT,VMR_ICE,TAU_ICE,RICE,& … … 109 109 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(OUT ) :: & 110 110 RTHBLTEN,RUBLTEN,RVBLTEN, & 111 HR_SW,HR_LW, RDUST,VMR_ICE,RICE111 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,RDUST,VMR_ICE,RICE 112 112 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: & 113 113 M_Q2 … … 138 138 ! ------> inputs: 139 139 INTEGER :: ngrid,nlayer,nq,nsoil 140 REAL :: pday,ptime,MY 140 REAL*8 :: pday,ptime 141 REAL :: MY 141 142 REAL :: phisfi_val 142 143 LOGICAL :: firstcall,lastcall 143 144 ! ---------- 144 REAL ,DIMENSION(:,:),ALLOCATABLE :: pplev,pplay,pphi,pu,pv,pt,flxw145 REAL ,DIMENSION(:,:,:),ALLOCATABLE :: pq145 REAL*8,DIMENSION(:,:),ALLOCATABLE :: pplev,pplay,pphi,pu,pv,pt,flxw 146 REAL*8,DIMENSION(:,:,:),ALLOCATABLE :: pq 146 147 147 148 ! <------ outputs: 148 149 ! physical tendencies 149 REAL ,DIMENSION(:),ALLOCATABLE :: pdpsrf150 REAL ,DIMENSION(:,:),ALLOCATABLE :: pdu,pdv,pdt151 REAL ,DIMENSION(:,:,:),ALLOCATABLE :: pdq150 REAL*8,DIMENSION(:),ALLOCATABLE :: pdpsrf 151 REAL*8,DIMENSION(:,:),ALLOCATABLE :: pdu,pdv,pdt,pdtheta 152 REAL*8,DIMENSION(:,:,:),ALLOCATABLE :: pdq 152 153 ! ... intermediate arrays 153 154 REAL, DIMENSION(:), ALLOCATABLE :: & … … 158 159 ! Additional control variables 159 160 INTEGER :: sponge_top,relax,ips,ipe,jps,jpe,kps,kpe 160 REAL :: elaps, ptimestep 161 REAL :: elaps 162 REAL*8 :: ptimestep 161 163 INTEGER :: test 162 164 REAL :: wappel_phys … … 173 175 dp_save 174 176 REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: & 175 du_save, dv_save, dt_save 177 du_save, dv_save, dt_save,dtheta_save 176 178 REAL, DIMENSION(:,:,:,:), ALLOCATABLE, SAVE :: & 177 179 dq_save … … 180 182 dp_save 181 183 REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: & 182 du_save, dv_save, dt_save 184 du_save, dv_save, dt_save,dtheta_save 183 185 REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: & 184 186 dq_save … … 191 193 192 194 !! 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 198 201 !================================================================== 199 202 ! CODE … … 301 304 ALLOCATE(dv_save(ngrid,nlayer,max_dom)) 302 305 ALLOCATE(dt_save(ngrid,nlayer,max_dom)) 306 ALLOCATE(dtheta_save(ngrid,nlayer,max_dom)) 303 307 ALLOCATE(dq_save(ngrid,nlayer,nq,max_dom)) 304 308 dp_save(:,:)=0. !! initialize these arrays ... … … 306 310 dv_save(:,:,:)=0. 307 311 dt_save(:,:,:)=0. 312 dtheta_save(:,:,:)=0. 308 313 dq_save(:,:,:,:)=0. 309 314 ENDIF … … 319 324 ALLOCATE(dv_save(ngrid,nlayer)) 320 325 ALLOCATE(dt_save(ngrid,nlayer)) 326 ALLOCATE(dtheta_save(ngrid,nlayer)) 321 327 ALLOCATE(dq_save(ngrid,nlayer,nq)) 322 328 ENDIF … … 325 331 dv_save(:,:)=0. 326 332 dt_save(:,:)=0. 333 dtheta_save(:,:)=0. 327 334 dq_save(:,:,:)=0. 328 335 flag_first_restart=.false. … … 369 376 ! ALLOCATE ! 370 377 !----------! 378 IF (.not.ALLOCATED(tname)) ALLOCATE(tname(nq)) 371 379 !-------------------------------------------------------------------------------! 372 380 ! outputs: ! … … 381 389 ALLOCATE(pdv(ngrid,nlayer)) 382 390 ALLOCATE(pdt(ngrid,nlayer)) 391 ALLOCATE(pdtheta(ngrid,nlayer)) 383 392 ALLOCATE(pdq(ngrid,nlayer,nq)) 384 393 !!! … … 392 401 pdv(:,:)=dv_save(:,:,id) 393 402 pdt(:,:)=dt_save(:,:,id) 403 pdtheta(:,:)=dtheta_save(:,:,id) 394 404 pdq(:,:,:)=dq_save(:,:,:,id) 395 405 #else 406 print*,'else' 396 407 pdpsrf(:)=dp_save(:) 397 408 pdu(:,:)=du_save(:,:) 398 409 pdv(:,:)=dv_save(:,:) 399 410 pdt(:,:)=dt_save(:,:) 411 pdtheta(:,:)=dtheta_save(:,:) 400 412 pdq(:,:,:)=dq_save(:,:,:) 401 413 #endif … … 442 454 !! tracers' name 443 455 PRINT *,'** ',planet_type,'** TRACERS NAMES' 444 CALL update_inputs_physiq_tracers(nq,MARS_MODE )456 CALL update_inputs_physiq_tracers(nq,MARS_MODE,tname) 445 457 !! PHYSICS VARIABLES (cf. iniphysiq in LMD GCM) 446 458 !! parameters are defined in the module_model_constants.F WRF routine … … 504 516 ENDIF 505 517 ENDIF 506 507 IF (MARS_MODE .EQ. 32) THEN508 IF (firstcall .EQV. .true. .and. (.not. restart)) THEN509 q_prof(:,7) = 0.95510 !! traceurs(7) = 'co2'511 ENDIF512 ENDIF513 514 518 515 519 IF (firstcall .EQV. .true.) THEN … … 621 625 M_ALBEDO,CST_AL,& 622 626 M_TSURF,M_EMISS,M_CO2ICE,& 623 M_GW,M_Z0, CST_Z0,&627 M_GW,M_Z0,& 624 628 M_H2OICE,& 625 629 phisfi_val) … … 653 657 pdv(:,:)=0. 654 658 pdt(:,:)=0. 659 pdtheta(:,:)=0. 655 660 pdq(:,:,:)=0. 656 661 print *, '** ',planet_type,'** CALL TO LMD PHYSICS' … … 662 667 ptime,pday,MY) 663 668 !!! 664 CALL call_physiq(planet_type,ngrid,nlayer,nq, 669 CALL call_physiq(planet_type,ngrid,nlayer,nq,tname, & 665 670 firstcall,lastcall, & 666 671 pday,ptime,ptimestep, & … … 679 684 ENDIF 680 685 #endif 686 687 IF (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 698 ENDIF 681 699 682 700 print *, '** ',planet_type,'** CALL TO LMD PHYSICS DONE' … … 694 712 DEALLOCATE(zrfi_omp) 695 713 696 697 714 !---------------------------------------------------------------------------------! 698 715 ! PHYSIQ TENDENCIES ARE SAVED TO BE SPLIT WITHIN INTERMEDIATE DYNAMICAL TIMESTEPS ! … … 703 720 dv_save(:,:,id)=pdv(:,:) 704 721 dt_save(:,:,id)=pdt(:,:) 722 dtheta_save(:,:,id)=pdtheta(:,:) 705 723 dq_save(:,:,:,id)=pdq(:,:,:) 706 724 #else … … 709 727 dv_save(:,:)=pdv(:,:) 710 728 dt_save(:,:)=pdt(:,:) 729 dtheta_save(:,:)=pdtheta(:,:) 711 730 dq_save(:,:,:)=pdq(:,:,:) 712 731 #endif … … 737 756 CALL update_outputs_physiq_turb( & 738 757 ims,ime,jms,jme,kms,kme,& 739 ips,ipe,jps,jpe, &758 ips,ipe,jps,jpe,kps,kpe,& 740 759 M_Q2,M_WSTAR,& 741 760 HFMAX,ZMAX,USTM,HFX) … … 746 765 SWDOWNZ,TAU_DUST,QSURFDUST,& 747 766 MTOT,ICETOT,TAU_ICE,& 748 HR_SW,HR_LW, &767 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,& 749 768 RDUST,VMR_ICE,RICE) 750 769 !!! 770 print*,"update_outputs_physiq_diag" 771 772 751 773 ENDIF call_physics 752 774 … … 770 792 ! --is the one calculated during the last call to physics ! 771 793 !------------------------------------------------------------------! 772 794 !print*,'pdt',pdt(1,1),pdt(1,nlayer) 795 !print*,'exner',exner(1,:,1) 773 796 DO j = jps,jpe 774 797 DO i = ips,ipe … … 778 801 ! zonal wind 779 802 RUBLTEN(i,kps:kpe,j) = pdu(subs,kps:kpe) 780 781 803 ! meridional wind 782 804 RVBLTEN(i,kps:kpe,j) = pdv(subs,kps:kpe) 783 784 805 ! potential temperature 785 806 ! (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 788 812 ! update surface pressure (cf CO2 cycle in physics) 789 813 ! here dt is needed 790 814 PSFC(i,j)=PSFC(i,j)+pdpsrf(subs)*dt 791 792 815 ! tracers 793 816 SCALAR(i,kps:kpe,j,1)=0. … … 807 830 ENDDO 808 831 ENDDO 809 810 832 DEALLOCATE(pdpsrf) 811 833 DEALLOCATE(pdu) … … 813 835 DEALLOCATE(pdt) 814 836 DEALLOCATE(pdq) 815 837 DEALLOCATE(pdtheta) 816 838 !!*****!! 817 839 !! END !!
Note: See TracChangeset
for help on using the changeset viewer.