Changeset 1398 for trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars
- Timestamp:
- Mar 18, 2015, 11:38:45 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_initialize_les.F.venus
r1387 r1398 118 118 !!MARS 119 119 120 REAL :: pfu, pfd, phm 121 INTEGER :: hypsometric_opt = 1 ! classic 122 !INTEGER :: hypsometric_opt = 2 ! Wee et al. 2012 correction 123 124 125 120 126 #ifdef DM_PARALLEL 121 127 # include <data_calls.inc> … … 164 170 165 171 166 !stretch_grid = .true.172 stretch_grid = .true. 167 173 ! FOR LES, set stretch to false 168 174 stretch_grid = .false. … … 170 176 ! z_scale = .50 171 177 z_scale = .40 178 z_scale = .25 179 z_scale = .15 172 180 pi = 2.*asin(1.0) 173 181 write(6,*) ' pi is ',pi … … 232 240 grid%step_number = 0 233 241 234 ! set up the grid235 242 !! set up the grid 243 ! 236 244 IF (stretch_grid) THEN ! exponential stretch for eta (nearly constant dz) 237 245 DO k=1, kde … … 240 248 ENDDO 241 249 ELSE 242 243 !!!MARS 244 grid%znw(1)=1.000 245 grid%znw(2)=0.9995 !5m 246 grid%znw(3)=0.9980 !20m 247 grid%znw(4)=0.9950 !55m 248 DO k=5, kde 249 grid%znw(k) = grid%znw(4) * ( 1. - float(k-4)/float(kde-4) ) 250 ENDDO 250 ! 251 251 !!!!MARS 252 !! 253 ! DO k=1, kde 254 ! grid%znw(k) = 1. - float(k-1)/float(kde-1) 255 ! ENDDO 256 257 ENDIF 252 !grid%znw(1)=1.000 253 !grid%znw(2)=0.9995 !5m 254 !grid%znw(3)=0.9980 !20m 255 !grid%znw(4)=0.9950 !55m 256 !DO k=5, kde 257 ! grid%znw(k) = grid%znw(4) * ( 1. - float(k-4)/float(kde-4) ) 258 !ENDDO 259 !!!!!MARS 260 !!! 261 !! DO k=1, kde 262 !! grid%znw(k) = 1. - float(k-1)/float(kde-1) 263 !! ENDDO 264 ! 265 ! ENDIF 266 267 !!MARS 268 !!MARS 269 open(unit=12,file='levels',form='formatted',status='old') 270 rewind(12) 271 DO k=1, kde 272 read(12,*) grid%znw(k) 273 write(6,*) 'read level ', k,grid%znw(k) 274 ENDDO 275 close(12) 276 !!MARS 277 !!MARS 278 ENDIF 258 279 259 280 DO k=1, kde-1 … … 419 440 ! respect to the model eqns. 420 441 442 IF (hypsometric_opt == 1) THEN 421 443 DO k = 2,kte 422 444 grid%phb(i,k,j) = grid%phb(i,k-1,j) - grid%dnw(k-1)*grid%mub(i,j)*grid%alb(i,k-1,j) 423 445 ENDDO 446 ELSE IF (hypsometric_opt == 2) THEN 447 DO k = 2,kte 448 pfu = grid%mub(i,j)*grid%znw(k) + grid%p_top 449 pfd = grid%mub(i,j)*grid%znw(k-1) + grid%p_top 450 phm = grid%mub(i,j)*grid%znu(k-1) + grid%p_top 451 grid%phb(i,k,j) = grid%phb(i,k-1,j) + grid%alb(i,k-1,j)*phm*LOG(pfd/pfu) 452 END DO 453 END IF 454 424 455 425 456 ENDDO … … 501 532 502 533 grid%ph_1(i,1,j) = 0. 534 IF (hypsometric_opt == 1) THEN 503 535 DO k = 2,kte 504 536 grid%ph_1(i,k,j) = grid%ph_1(i,k-1,j) - (1./grid%rdnw(k-1))*( & … … 509 541 grid%ph0(i,k,j) = grid%ph_1(i,k,j) + grid%phb(i,k,j) 510 542 ENDDO 543 ELSE IF (hypsometric_opt == 2) THEN 544 545 ! Alternative hydrostatic eq.: dZ = -al*p*dLOG(p), where p is dry pressure. 546 ! Note that al*p approximates Rd*T and dLOG(p) does z. 547 ! Here T varies mostly linear with z, the first-order integration produces better result. 548 549 grid%ph_2(i,1,j) = grid%phb(i,1,j) 550 DO k = 2,kte 551 pfu = grid%mu0(i,j)*grid%znw(k) + grid%p_top 552 pfd = grid%mu0(i,j)*grid%znw(k-1) + grid%p_top 553 phm = grid%mu0(i,j)*grid%znu(k-1) + grid%p_top 554 grid%ph_2(i,k,j) = grid%ph_2(i,k-1,j) + grid%alt(i,k-1,j)*phm*LOG(pfd/pfu) 555 END DO 556 557 DO k = 1,kte 558 grid%ph_2(i,k,j) = grid%ph_2(i,k,j) - grid%phb(i,k,j) 559 grid%ph_1(i,k,j) = grid%ph_2(i,k,j) 560 END DO 561 562 END IF 563 564 511 565 512 566 IF ( wrf_dm_on_monitor() ) THEN … … 566 620 ! rebalance hydrostatically 567 621 622 IF (hypsometric_opt == 1) THEN 623 568 624 DO k = 2,kte 569 625 grid%ph_1(i,k,j) = grid%ph_1(i,k-1,j) - (1./grid%rdnw(k-1))*( & … … 575 631 ENDDO 576 632 633 ELSE IF (hypsometric_opt == 2) THEN 634 635 ! Alternative hydrostatic eq.: dZ = -al*p*dLOG(p), where p is dry pressure. 636 ! Note that al*p approximates Rd*T and dLOG(p) does z. 637 ! Here T varies mostly linear with z, the first-order integration produces better result. 638 639 grid%ph_2(i,1,j) = grid%phb(i,1,j) 640 DO k = 2,kte 641 pfu = grid%mu0(i,j)*grid%znw(k) + grid%p_top 642 pfd = grid%mu0(i,j)*grid%znw(k-1) + grid%p_top 643 phm = grid%mu0(i,j)*grid%znu(k-1) + grid%p_top 644 grid%ph_2(i,k,j) = grid%ph_2(i,k-1,j) + grid%alt(i,k-1,j)*phm*LOG(pfd/pfu) 645 END DO 646 647 DO k = 1,kte 648 grid%ph_2(i,k,j) = grid%ph_2(i,k,j) - grid%phb(i,k,j) 649 grid%ph_1(i,k,j) = grid%ph_2(i,k,j) 650 END DO 651 652 END IF 653 654 577 655 ENDDO 578 656 ENDDO … … 609 687 z_at_v = 0.5*(grid%phb(i,1,j)+grid%phb(i,1,j-1))/g 610 688 END IF 689 611 690 p_surf = interp_0( p_in, zk, z_at_v, nl_in ) 612 691 … … 879 958 real qvf, qvf1, dz 880 959 960 LOGICAL :: direct_from_file = .true. 961 881 962 ! first, read the sounding 882 963 883 964 call read_sounding( p_surf, th_surf, qv_surf, & 884 h_input, th_input, qv_input, u_input, v_input,n, nl, debug ) 965 h_input, th_input, qv_input, & 966 u_input, v_input,n, nl, debug ) 885 967 886 968 ! and the therm : 887 969 888 970 call read_therm(r_therm,cp_therm,p_therm,rho_therm,t_therm,n) 971 972 if(debug) write(6,*) ' number of input levels = ',nl 973 nl_in = nl 974 if(nl_in .gt. nl_max ) then 975 write(6,*) ' too many levels for input arrays ',nl_in,nl_max 976 call wrf_error_fatal ( ' too many levels for input arrays ' ) 977 end if 978 979 IF (.NOT. direct_from_file) THEN 889 980 890 981 ! To use r/cp as defined above, one has to recompute teta from T (default MCD computes … … 902 993 ! enddo 903 994 !endif 904 905 if(debug) write(6,*) ' number of input levels = ',nl906 907 nl_in = nl908 if(nl_in .gt. nl_max ) then909 write(6,*) ' too many levels for input arrays ',nl_in,nl_max910 call wrf_error_fatal ( ' too many levels for input arrays ' )911 end if912 995 913 996 ! compute diagnostics, … … 964 1047 qvf1 = 1. 965 1048 !!MARS 1049 966 1050 do it=1,10 967 1051 pm_input(k) = pm_input(k-1) & … … 982 1066 p_input(k) = p_input(k+1) + 0.5*dz*(rho_input(k)+rho_input(k+1))*g 983 1067 enddo 1068 1069 ELSE !IF (.NOT. direct_from_file) THEN 1070 1071 do k=1,nl 1072 !!!! direct input from file 1073 write(6,*) '*** DIRECT INPUT FROM FILE ***' 1074 pm_input(k) = p_therm(k) 1075 p_input(k) = p_therm(k) 1076 rho_input(k) = rho_therm(k) 1077 enddo 1078 1079 ENDIF 984 1080 985 1081
Note: See TracChangeset
for help on using the changeset viewer.