Changeset 1724 for trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2
- Timestamp:
- Jul 21, 2017, 4:07:38 PM (7 years ago)
- Location:
- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2
- Files:
-
- 12 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM
r1611 r1724 112 112 state real WSTAR ij misc 1 - rd "WSTAR" "FREE CONVECTION VELOCITY FROM TH" "m/s" #SAVEMARS2 wstar 113 113 state real Z0SET ij misc 1 - rd "Z0SET" "SET SURFACE ROUGHNESS" "m" #SAVEMARS2 z0 114 state real HR_DYN ikj misc 1 - - "HR_DYN" "HEATING RATE DYN" "K/s" 115 state real DDT ikj misc 1 - - "DDT" "TEMPERATURE TENDENCY" "K/s" 116 state real DT_RAD ikj misc 1 - - "DT_RAD" "RADIATIVE TEMPERATURE TENDENCY" "K/s" 117 state real DT_VDF ikj misc 1 - - "DT_VDF" "PBL CLMAIN TEMPERATURE TENDENCY" "K/s" 118 state real DT_AJS ikj misc 1 - - "DT_AJS" "AJUSTEMENT SEC TEMPERATURE TENDENCY" "K/s" 114 119 115 120 #### -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM.newphys
r1635 r1724 80 80 state real HR_SW ikj misc 1 - h "HR_SW" "HEATING RATE SW" "K/s" 81 81 state real HR_LW ikj misc 1 - h "HR_LW" "HEATING RATE LW" "K/s" 82 state real HR_DYN ikj misc 1 - - "HR_DYN" "HEATING RATE DYN" "K/s" 83 state real DDT ikj misc 1 - - "DDT" "TEMPERATURE TENDENCY" "K/s" 84 state real DT_RAD ikj misc 1 - - "DT_RAD" "RADIATIVE TEMPERATURE TENDENCY" "K/s" 85 state real DT_VDF ikj misc 1 - - "DT_VDF" "PBL CLMAIN TEMPERATURE TENDENCY" "K/s" 86 state real DT_AJS ikj misc 1 - - "DT_AJS" "AJUSTEMENT SEC TEMPERATURE TENDENCY" "K/s" 82 87 state real SWDOWNZ ij misc 1 - h "SWDOWNZ" "DOWNWARD SW FLUX AT SURFACE" "W m-2" 83 88 #### DUST CYCLE … … 106 111 #### - effacer le h si l'on veut eviter les sorties 107 112 #### 108 state real - ikjftb scalar 1 - - - 109 state real qh2o ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O" "Water vapor mixing ratio" "kg kg-1" 110 state real qh2o_ice ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O_ICE" "Water ice mixing ratio" "kg kg-1" 111 state real qdust ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QDUST" "Dust mixing ratio" "kg kg-1" 112 state real qdustn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QDUSTN" "Dust_number mixing ratio" "kg kg-1" 113 state real qccn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCN" "CCN mixing ratio" "kg kg-1" 114 state real qccnn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCNN" "CCN number mixing ratio" "kg kg-1" 115 state real qco2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCO2" "CO2 mixing ratio" "kg kg-1" 116 state real qco2_ice ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCO2_ICE" "CO2 ice mixing ratio" "kg kg-1" 117 state real qccn_co2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCN_CO2" "CO2 CCN mixing ratio" "kg kg-1" 118 state real qccnn_co2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCNN_CO2" "CO2 CCN number mixing ratio" "kg kg-1" 113 state real - ikjftb scalar 1 - - - 114 state real qh2o ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O" "Water vapor mixing ratio" "kg kg-1" 115 state real qh2o_ice ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QH2O_ICE" "Water ice mixing ratio" "kg kg-1" 116 state real qdust ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QDUST" "Dust mixing ratio" "kg kg-1" 117 state real qdustn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QDUSTN" "Dust_number mixing ratio" "kg kg-1" 118 state real qccn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCN" "CCN mixing ratio" "kg kg-1" 119 state real qccnn ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCCNN" "CCN number mixing ratio" "kg kg-1" 120 state real qco2 ikjftb scalar 1 - i01rhusdf=(bdy_interp:dt) "QCO2" "CO2 mixing ratio" "kg kg-1" 119 121 state real chem_co ikjftb scalar 1 - i01rusdf=(bdy_interp:dt) "chem_co" "" "" 120 122 state real chem_o ikjftb scalar 1 - i01rusdf=(bdy_interp:dt) "chem_o" "" "" … … 130 132 state real chem_n2 ikjftb scalar 1 - i01rusdf=(bdy_interp:dt) "chem_n2" "" "" 131 133 state real chem_ar ikjftb scalar 1 - i01rusdf=(bdy_interp:dt) "chem_ar" "" "" 134 #### 132 135 #### 133 136 ####MARS MARS MARS MARS MARS … … 1267 1270 rconfig logical pert_coriolis namelist,dynamics max_domains .false. irh "pert_coriolis" "" "" 1268 1271 rconfig logical mix_full_fields namelist,dynamics max_domains .false. irh "mix_full_field" "" "" 1269 rconfig real base_pres namelist,dynamics 1 610.h "base_pres" "Mars Base state pressure, real only" "Pa"1270 rconfig real base_temp namelist,dynamics 1 220. h "base_temp" "Mars Base state sea level temperature, real only" "K"1271 rconfig real base_lapse namelist,dynamics 1 30. h "base_lapse" "Mars Base state temperature difference between base pres and 1/e of atm depth - do not change, real only" "K"1272 rconfig real base_pres namelist,dynamics 1 9.2e6 h "base_pres" "Mars Base state pressure, real only" "Pa" 1273 rconfig real base_temp namelist,dynamics 1 735. h "base_temp" "Mars Base state sea level temperature, real only" "K" 1274 rconfig real base_lapse namelist,dynamics 1 100. h "base_lapse" "Mars Base state temperature difference between base pres and 1/e of atm depth - do not change, real only" "K" 1272 1275 rconfig real tiso namelist,dynamics 1 140. h "tiso" "Mars isothermal value for high alt, real only" "K" 1273 1276 … … 1354 1357 package newwater mars==11 - scalar:qh2o,qh2o_ice,qdust,qdustn 1355 1358 package newwatersca mars==12 - scalar:qh2o,qh2o_ice,qdust,qdustn,qccn,qccnn 1356 package cloudco2 mars==32 - scalar:qh2o,qh2o_ice,qdust,qdustn,qccn,qccnn,qco2,qco2_ice,qccn_co2,qccnn_co21357 1359 package photochem mars==42 - scalar:qco2,chem_co,chem_o,chem_o1d,chem_o2,chem_o3,chem_h,chem_h2,chem_oh,chem_ho2,chem_h2o2,chem_ch4,chem_n2,chem_ar,qh2o_ice,qh2o,qdust,qdustn 1358 1360 ##### MARS OPTIONS -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_big_step_utilities_em.F
r11 r1724 18 18 USE module_configure 19 19 USE module_wrf_error 20 21 20 CONTAINS 22 21 … … 569 568 ENDDO 570 569 ENDDO 571 570 !print*,'muu(i,j)',muu(1,:) 572 571 ELSE IF (name .EQ. 'v')THEN 573 572 … … 588 587 ENDDO 589 588 ENDDO 590 589 !print*,'muv(i,j)',muv(1,:) 591 590 ELSE IF (name .EQ. 'w')THEN 592 591 itf=MIN(ite,ide-1) … … 621 620 ENDDO 622 621 ENDDO 623 622 !print*,'field(i,k,j)',field(1,:,1) 623 !print*,'(mu(i,j)+mub(i,j))',(mu(1,:)+mub(1,:)) 624 624 ENDIF 625 625 … … 1052 1052 1053 1053 IF (non_hydrostatic) THEN 1054 1054 print*,'n_moist',n_moist 1055 print*,'PARAM_FIRST_SCALAR',PARAM_FIRST_SCALAR 1055 1056 IF (n_moist >= PARAM_FIRST_SCALAR ) THEN 1056 1057 print*,'p(i,k,j)_before',p(1,:,1) 1057 1058 DO j=jts,jtf 1058 1059 DO k=kts,ktf … … 1075 1076 ENDDO 1076 1077 ENDDO 1077 1078 print*,'p(i,k,j)_after',p(1,:,1) 1078 1079 ELSE 1079 1080 … … 4075 4076 INTEGER :: i_start, i_end, j_start, j_end, k_start, k_end, i_startu, j_startv 4076 4077 INTEGER :: i, j, k 4077 REAL :: w1, w2, z0, z1, z2 4078 REAL :: w1, w2, z0, z1, z2,temp 4078 4079 4079 4080 !----------------------------------------------------------------------- … … 4099 4100 4100 4101 ! compute thermodynamics and velocities at pressure points 4101 4102 4102 do j = j_start,j_end 4103 4103 do k = k_start, k_end … … 4107 4107 p_phy(i,k,j) = p(i,k,j) + pb(i,k,j) 4108 4108 pi_phy(i,k,j) = (p_phy(i,k,j)/p1000mb)**rcp 4109 t_phy(i,k,j) = th_phy(i,k,j)*pi_phy(i,k,j) 4109 IF (planet .eq. "venus" ) THEN 4110 t_phy(i,k,j)= (th_phy(i,k,j)**nu - nu*(TT00**nu)*log((p1000mb/p_phy(i,k,j))**rcp))**(1/nu) 4111 ELSE 4112 t_phy(i,k,j) = th_phy(i,k,j)*pi_phy(i,k,j) 4113 ENDIF 4110 4114 rho(i,k,j) = 1./alt(i,k,j)*(1.+moist(i,k,j,P_QV)) 4111 4115 mu_3d(i,k,j) = mu(i,j) -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_init_utilities.F
r11 r1724 91 91 END FUNCTION interp_0 92 92 93 real function interp_0_log( v_in, & 94 p_in, p_out, nz_in ) 95 implicit none 96 integer nz_in, nz_out 97 real v_in(nz_in), p_in(nz_in) 98 real p_out 99 100 integer kp, k, im, ip 101 logical interp, increasing_z 102 real height, w1, w2 103 logical debug 104 parameter ( debug = .false. ) 105 106 ! does vertical coordinate increase or decrease with increasing k? 107 ! set offset appropriately 108 109 height = p_out 110 111 if(debug) write(6,*) ' height in interp_0 ',height 112 113 if (p_in(nz_in) .gt. p_in(1)) then 114 115 if(debug) write(6,*) ' monotonic increase in z in interp_0 ' 116 IF (height > p_in(nz_in)) then 117 if(debug) write(6,*) ' point 1 in interp_0 ' 118 w2 = log(p_in(nz_in)/height)/log(p_in(nz_in)/p_in(nz_in-1)) 119 w1 = 1.-w2 120 interp_0_log = w1*v_in(nz_in) + w2*v_in(nz_in-1) 121 ELSE IF (height < p_in(1)) then 122 if(debug) write(6,*) ' point 2 in interp_0 ' 123 w2 = log(p_in(2)/height)/log(p_in(2)/p_in(1)) 124 w1 = 1.-w2 125 interp_0_log = w1*v_in(2) + w2*v_in(1) 126 ELSE 127 if(debug) write(6,*) ' point 3 in interp_0 ' 128 interp = .false. 129 kp = nz_in 130 DO WHILE ( (interp .eqv. .false.) .and. (kp .ge. 2) ) 131 IF( ((p_in(kp) .ge. height) .and. & 132 (p_in(kp-1) .le. height)) ) THEN 133 w2 = log(height/p_in(kp))/log(p_in(kp-1)/p_in(kp)) 134 w1 = 1.-w2 135 interp_0_log = w1*v_in(kp) + w2*v_in(kp-1) 136 if(debug) write(6,*) ' interp data, kp, w1, w2 ',kp, w1, w2 137 if(debug) write(6,*) ' interp data, v_in(kp), v_in(kp-1), interp_0_p ', & 138 v_in(kp), v_in(kp-1), interp_0_log 139 interp = .true. 140 END IF 141 kp = kp-1 142 ENDDO 143 ENDIF 144 145 else 146 147 if(debug) write(6,*) ' monotonic decrease in z in interp_0 ' 148 149 IF (height < p_in(nz_in)) then 150 if(debug) write(6,*) ' point 1 in interp_0 ' 151 w2 = log(p_in(nz_in)/height)/log(p_in(nz_in)/p_in(nz_in-1)) 152 w1 = 1.-w2 153 interp_0_log = w1*v_in(nz_in) + w2*v_in(nz_in-1) 154 ELSE IF (height > p_in(1)) then 155 if(debug) write(6,*) ' point 2 in interp_0 ' 156 w2 = log(p_in(2)/height)/log(p_in(2)/p_in(1)) 157 w1 = 1.-w2 158 interp_0_log = w1*v_in(2) + w2*v_in(1) 159 ELSE 160 if(debug) write(6,*) ' point 3 in interp_0 ' 161 interp = .false. 162 kp = nz_in 163 height = p_out 164 DO WHILE ( (interp .eqv. .false.) .and. (kp .ge. 2) ) 165 IF( ((p_in(kp) .le. height) .and. & 166 (p_in(kp-1) .ge. height)) ) THEN 167 w2 = log(height/p_in(kp))/log(p_in(kp-1)/p_in(kp)) 168 w1 = 1.-w2 169 interp_0_log = w1*v_in(kp) + w2*v_in(kp-1) 170 interp = .true. 171 END IF 172 kp = kp-1 173 ENDDO 174 ENDIF 175 176 end if 177 178 return 179 END FUNCTION interp_0_log 180 93 181 END MODULE module_init_utilities 94 182 -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F
r1662 r1724 21 21 USE module_soil_pre 22 22 USE module_date_time 23 use module_init_utilities 23 24 #ifdef DM_PARALLEL 24 25 USE module_dm … … 118 119 REAL :: max_dz 119 120 120 ! INTEGER , PARAMETER :: nl_max = 1000 121 INTEGER , PARAMETER :: nl_max = 1000 122 INTEGER :: nl_in 121 123 ! REAL , DIMENSION(nl_max) :: grid%em_dn 122 124 REAL, DIMENSION(nl_max) :: pd_in 125 REAL, DIMENSION(nl_max) :: profdustq,profdustn 123 126 integer::oops1,oops2 124 127 … … 149 152 !LOGICAL :: interp_theta = .false. ! Wee et al. 2012 correction 150 153 REAL :: pfu, pfd, phm 151 154 REAL :: tpot 152 155 153 156 #ifdef DM_PARALLEL … … 1080 1083 !!END DO 1081 1084 1082 1085 IF ( planet == "mars" ) then 1083 1086 !--get vertical size of the GCM input array and allocate new stuff 1084 sizegcm=SIZE(grid%em_rh_gc(1,:,1))1085 ALLOCATE(sig(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))1086 !ALLOCATE(ap(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))1087 ALLOCATE(bp(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))1088 1089 DO j = jts , MIN ( jde-1 , jte )1090 DO i = its , MIN (ide-1 , ite )1087 sizegcm=SIZE(grid%em_rh_gc(1,:,1)) 1088 ALLOCATE(sig(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1)) 1089 !ALLOCATE(ap(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1)) 1090 ALLOCATE(bp(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1)) 1091 1092 DO j = jts , MIN ( jde-1 , jte ) 1093 DO i = its , MIN (ide-1 , ite ) 1091 1094 1092 1095 !!! Define old sigma levels for each column 1093 sig(i,:,j)=grid%em_p_gc(i,:,j)/grid%em_psfc_gc(i,j)1096 sig(i,:,j)=grid%em_p_gc(i,:,j)/grid%em_psfc_gc(i,j) 1094 1097 1095 1098 !!! Compute new sigma levels from old sigma levels with GCM (low-res) and WRF (hi-res) surface pressure 1096 1099 !!! (dimlevs,sigma_gcm, ps_gcm, ps_hr, sigma_hr) 1097 CALL build_sigma_hr(sizegcm,sig(i,:,j),grid%em_psfc_gc(i,j),grid%psfc(i,j),bp(i,:,j))1100 CALL build_sigma_hr(sizegcm,sig(i,:,j),grid%em_psfc_gc(i,j),grid%psfc(i,j),bp(i,:,j)) 1098 1101 1099 1102 !!! Calculate new pressure levels 1100 grid%em_pd_gc(i,:,j)=bp(i,:,j)*grid%psfc(i,j)1101 1102 END DO1103 END DO1104 1105 DEALLOCATE(sig)1106 DEALLOCATE(bp)1103 grid%em_pd_gc(i,:,j)=bp(i,:,j)*grid%psfc(i,j) 1104 1105 END DO 1106 END DO 1107 1108 DEALLOCATE(sig) 1109 DEALLOCATE(bp) 1107 1110 1108 1111 !!****MARS who knows... 1109 grid%em_rh_gc(:,:,:)=0.1112 grid%em_rh_gc(:,:,:)=0. 1110 1113 1111 1114 … … 1113 1116 !grid%em_pd_gc=grid%em_p_gc 1114 1117 !!****MARS 1115 1118 ELSE ! VENUS 1116 1119 1117 1120 … … 1120 1123 !! dry top pressure (constant). 1121 1124 ! 1122 !CALL p_dts ( grid%em_mu0 , grid%em_intq_gc , grid%psfc , grid%p_top , & 1123 ! ids , ide , jds , jde , 1 , num_metgrid_levels , & 1124 ! ims , ime , jms , jme , 1 , num_metgrid_levels , & 1125 ! its , ite , jts , jte , 1 , num_metgrid_levels ) 1126 1125 CALL p_dts ( grid%em_mu0 , grid%em_intq_gc , grid%psfc , grid%p_top , & 1126 ids , ide , jds , jde , 1 , num_metgrid_levels , & 1127 ims , ime , jms , jme , 1 , num_metgrid_levels , & 1128 its , ite , jts , jte , 1 , num_metgrid_levels ) 1129 ENDIF 1130 IF ( planet == "mars" ) then 1127 1131 !!****MARS 1128 DO j = jts , MIN ( jde-1 , jte )1129 DO i = its , MIN (ide-1 , ite )1130 1131 grid%em_mu0(i,j) = grid%psfc(i,j) - grid%p_top1132 1133 END DO1134 END DO1132 DO j = jts , MIN ( jde-1 , jte ) 1133 DO i = its , MIN (ide-1 , ite ) 1134 1135 grid%em_mu0(i,j) = grid%psfc(i,j) - grid%p_top 1136 1137 END DO 1138 END DO 1135 1139 !!****MARS 1136 1140 ELSE ! VENUS 1137 1141 1138 1142 !! Compute the dry, hydrostatic surface pressure. 1139 1143 ! 1140 !CALL p_dhs ( grid%em_pdhs , grid%ht , p00 , t00 , a , & 1141 ! ids , ide , jds , jde , kds , kde , & 1142 ! ims , ime , jms , jme , kms , kme , & 1143 ! its , ite , jts , jte , kts , kte ) 1144 CALL p_dhs ( grid%em_pdhs , grid%ht , p00 , t00 , a , & 1145 ids , ide , jds , jde , kds , kde , & 1146 ims , ime , jms , jme , kms , kme , & 1147 its , ite , jts , jte , kts , kte ) 1148 ENDIF 1144 1149 !!****MARS: voir remarques dans la routine 1145 1150 !!****MARS: dry hydrostatic pressure comes from the GCM ... … … 2294 2299 IF (( i .EQ. its ) .AND. ( j .EQ. jts )) print *, temp, k 2295 2300 !!! MODIF WRFV3.1 - parameter tiso 2296 grid%em_t_init(i,k,j) = temp*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0 2301 IF (planet .eq. "mars" ) THEN 2302 grid%em_t_init(i,k,j) = temp*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0 2303 ELSE 2304 grid%em_t_init(i,k,j) = (temp**nu + nu*(TT00**nu)*log((p00/grid%em_pb(i,k,j))**rcp))**(1/nu) -t0 2305 ENDIF 2297 2306 grid%em_alb(i,k,j) = (r_d/p1000mb)*(grid%em_t_init(i,k,j)+t0)*(grid%em_pb(i,k,j)/p1000mb)**cvpm 2298 2307 END DO … … 2601 2610 !!NB: q2 is used for other purpose ... 2602 2611 2603 2604 2612 ! END IF 2605 2613 … … 2780 2788 temp1 = MAX(tiso,t00+A*LOG(grid%em_pb(i,k,j)/p00)) 2781 2789 temp2 = MAX(tiso,t00+A*LOG( pb_int/p00)) 2782 grid%em_t_init(i,k,j) = temp1*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0 2783 t_init_int(i,k,j) = temp2*(p00/pb_int )**(r_d/cp) - t0 2790 IF (planet .eq. "mars" ) THEN 2791 grid%em_t_init(i,k,j) = temp1*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0 2792 t_init_int(i,k,j) = temp2*(p00/pb_int )**(r_d/cp) - t0 2793 ELSE 2794 ENDIF 2784 2795 grid%em_alb(i,k,j) = (r_d/p1000mb)*(grid%em_t_init(i,k,j)+t0)*(grid%em_pb(i,k,j)/p1000mb)**cvpm 2785 2796 END DO … … 4969 4980 ! temp = t00 + A*LOG(pb/p00) 4970 4981 temp = MAX ( tiso, t00 + A*LOG(pb/p00) ) 4971 t_init = temp*(p00/pb)**(r_d/cp) - t0 4982 IF (planet .eq. "mars" ) THEN 4983 t_init = temp*(p00/pb)**(r_d/cp) - t0 4984 ELSE 4985 t_init = (temp**nu + nu*(TT00**nu)*log((p00/pb)**(rcp)))**(1/nu) - t0 4986 ENDIF 4972 4987 alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm 4973 4988 END DO … … 5005 5020 ! temp = t00 + A*LOG(pb/p00) 5006 5021 temp = MAX ( tiso, t00 + A*LOG(pb/p00) ) 5007 t_init = temp*(p00/pb)**(r_d/cp) - t0 5022 IF (planet .eq. "mars" ) THEN 5023 t_init = temp*(p00/pb)**(r_d/cp) - t0 5024 ELSE 5025 t_init = (temp**nu + nu*(TT00**nu)*log((p00/pb)**(rcp)))**(1/nu) -t0 5026 ENDIF 5008 5027 alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm 5009 5028 znw(k+1) = znw(k) - dz*g / ( mub*alb(k) ) … … 5025 5044 ! temp = t00 + A*LOG(pb/p00) 5026 5045 temp = MAX ( tiso, t00 + A*LOG(pb/p00) ) 5027 t_init = temp*(p00/pb)**(r_d/cp) - t0 5046 IF (planet .eq. "mars" ) THEN 5047 t_init = temp*(p00/pb)**(r_d/cp) - t0 5048 ELSE 5049 t_init = (temp**nu + nu*(TT00**nu)*log((p00/pb)**(rcp)))**(1/nu) -t0 5050 ENDIF 5028 5051 alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm 5029 5052 znw(k+1) = znw(k) - dz*g / ( mub*alb(k) ) … … 5052 5075 ! temp = t00 + A*LOG(pb/p00) 5053 5076 temp = MAX ( tiso, t00 + A*LOG(pb/p00) ) 5054 t_init = temp*(p00/pb)**(r_d/cp) - t0 5077 IF (planet .eq. "mars" ) THEN 5078 t_init = temp*(p00/pb)**(r_d/cp) - t0 5079 ELSE 5080 t_init = (temp**nu + nu*(TT00**nu)*log((p00/pb)**(rcp)))**(1/nu) -t0 5081 ENDIF 5055 5082 alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm 5056 5083 END DO … … 5720 5747 end subroutine build_sigma_hr 5721 5748 5722 5723 5724 5725 5726 5749 END MODULE module_initialize 5727 5750 -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F
r1590 r1724 160 160 ijds = min(ids, jds) 161 161 ijde = max(ide, jde) 162 162 !num_moist = 3 163 163 num_3d_m = num_moist 164 164 num_3d_c = num_chem … … 892 892 & ,HR_SW=grid%HR_SW & 893 893 & ,HR_LW=grid%HR_LW & 894 & ,HR_DYN=grid%HR_DYN & 895 & ,DDT=grid%DDT & 896 & ,DT_RAD=grid%DT_RAD & 897 & ,DT_VDF=grid%DT_VDF & 898 & ,DT_AJS=grid%DT_AJS & 894 899 & ,SWDOWNZ=grid%SWDOWNZ & 895 900 & ,TAU_DUST=grid%TAU_DUST & -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_mars_lmd_new/update_outputs_physiq_mod.F
r1590 r1724 160 160 SWDOWNZ,TAU_DUST,QSURFDUST,& 161 161 MTOT,ICETOT,TAU_ICE,& 162 HR_SW,HR_LW, &162 HR_SW,HR_LW,HR_DYN,DT,DTRAD,DTVDF,DTAJS,& 163 163 RDUST,VMR_ICE,RICE) 164 164 … … 171 171 MTOT,ICETOT,TAU_ICE 172 172 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: & 173 HR_SW,HR_LW,RDUST,VMR_ICE,RICE 173 HR_SW,HR_LW,RDUST,VMR_ICE,RICE,HR_DYN,DT,DTRAD,DTVDF,DTAJS 174 174 INTEGER :: i,j,subs 175 175 -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_prescribed_void_lmd_new/update_outputs_physiq_mod.F
r1603 r1724 52 52 SUBROUTINE update_outputs_physiq_turb( & 53 53 ims,ime,jms,jme,kms,kme,& 54 ips,ipe,jps,jpe, &54 ips,ipe,jps,jpe,kps,kpe,& 55 55 M_Q2,M_WSTAR,& 56 56 HFMAX,ZMAX,USTM,HFX) … … 67 67 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 68 68 SUBROUTINE update_outputs_physiq_diag( & 69 70 71 72 73 HR_SW,HR_LW,&74 69 ims,ime,jms,jme,kms,kme,& 70 ips,ipe,jps,jpe,kps,kpe,& 71 SWDOWNZ,TAU_DUST,QSURFDUST,& 72 MTOT,ICETOT,TAU_ICE,& 73 HR_SW,HR_LW,HR_DYN,DT,DTRAD,DTVDF,DTAJS,& 74 RDUST,VMR_ICE,RICE) 75 75 76 76 INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme … … 80 80 MTOT,ICETOT,TAU_ICE 81 81 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: & 82 HR_SW,HR_LW, RDUST,VMR_ICE,RICE82 HR_SW,HR_LW,HR_DYN,RDUST,VMR_ICE,RICE,DT,DTRA,DTVDF,DTAJS 83 83 INTEGER :: i,j,k,subs 84 REAL, DIMENSION(kms:kme) :: phr_sw,phr_lw 84 REAL, DIMENSION(kms:kme) :: phr_sw,phr_lw,phr_dyn 85 85 86 86 open(17,file='prescribed_sw.txt',form='formatted',status='old') 87 87 open(18,file='prescribed_lw.txt',form='formatted',status='old') 88 open(19,file='prescribed_dyn.txt',form='formatted',status='old') 88 89 rewind(17) 89 90 rewind(18) 91 rewind(19) 90 92 DO k=1,kpe-kps+1 91 93 read(17,*) phr_sw(k) 92 94 read(18,*) phr_lw(k) 95 read(19,*) phr_dyn(k) 93 96 ENDDO 97 close(19) 98 close(18) 94 99 close(17) 95 close(18) 96 print*,'phr_lw',phr_lw 100 !print*,'phr_lw',phr_lw 97 101 DO j=jps,jpe 98 102 DO i=ips,ipe 99 103 HR_SW(i,:,j)=phr_sw(:) 100 104 HR_LW(i,:,j)=phr_lw(:) 105 HR_DYN(i,:,j)=phr_dyn(:) 101 106 ENDDO 102 107 ENDDO -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_venus_lmd_new/callphysiq_mod.F
r1634 r1724 12 12 CONTAINS 13 13 14 SUBROUTINE call_physiq(planet_type, klon,llm,nqtot, 14 SUBROUTINE call_physiq(planet_type, klon,llm,nqtot,tname, & 15 15 debut_split,lafin_split, & 16 16 jD_cur,jH_cur_split,zdt_split, & … … 23 23 24 24 USE physiq_mod, ONLY: physiq 25 USE module_model_constants, only : p0,rcp 25 USE module_model_constants, only : p0,rcp,cp 26 use moyzon_mod, only: tmoy 26 27 IMPLICIT NONE 27 28 … … 31 32 INTEGER,INTENT(IN) :: llm ! number of atmospheric layers 32 33 INTEGER,INTENT(IN) :: nqtot ! number of tracers 34 CHARACTER(len=*),INTENT(IN) :: tname(nqtot) ! tracer names 33 35 LOGICAL,INTENT(IN) :: debut_split ! .true. if very first call to physics 34 36 LOGICAL,INTENT(IN) :: lafin_split ! .true. if last call to physics 35 REAL* 4,INTENT(IN) :: JD_cur ! Julian day36 REAL* 4,INTENT(IN) :: JH_cur_split ! Julian hour (fraction of day)37 REAL* 4,INTENT(IN) :: zdt_split ! time step over which the physics are evaluated38 REAL* 4,INTENT(IN) :: zplev_omp(klon,llm+1) ! interlayer pressure (Pa)39 REAL* 4,INTENT(IN) :: zplay_omp(klon,llm) ! mid-layer pressure (Pa)40 REAL* 4,INTENT(INOUT) :: zpk_omp(klon,llm)41 REAL* 4,INTENT(IN) :: zphi_omp(klon,llm) ! geopotential at midlayer42 REAL* 4,INTENT(INOUT) :: zphis_omp(klon) ! surface geopotential43 REAL* 4,INTENT(INOUT) :: presnivs_omp(llm) ! approximate pressure of atm. layers44 REAL* 4,INTENT(IN) :: zufi_omp(klon,llm) ! zonal wind (m/s)45 REAL* 4,INTENT(IN) :: zvfi_omp(klon,llm) ! meridional wind (m/s)46 REAL* 4,INTENT(INOUT) :: zrfi_omp(klon,llm) ! relative wind vorticity, in s-147 REAL* 4,INTENT(IN) :: ztfi_omp(klon,llm) ! temperature (K)48 REAL* 4,INTENT(IN) :: zqfi_omp(klon,llm,nqtot) ! tracers (*/kg of air)49 REAL* 4,INTENT(IN) :: flxwfi_omp(klon,llm) ! Vertical mass flux on lower mesh interfaces (kg/s)37 REAL*8,INTENT(IN) :: JD_cur ! Julian day 38 REAL*8,INTENT(IN) :: JH_cur_split ! Julian hour (fraction of day) 39 REAL*8,INTENT(IN) :: zdt_split ! time step over which the physics are evaluated 40 REAL*8,INTENT(IN) :: zplev_omp(klon,llm+1) ! interlayer pressure (Pa) 41 REAL*8,INTENT(IN) :: zplay_omp(klon,llm) ! mid-layer pressure (Pa) 42 REAL*8,INTENT(INOUT) :: zpk_omp(klon,llm) 43 REAL*8,INTENT(IN) :: zphi_omp(klon,llm) ! geopotential at midlayer 44 REAL*8,INTENT(INOUT) :: zphis_omp(klon) ! surface geopotential 45 REAL*8,INTENT(INOUT) :: presnivs_omp(llm) ! approximate pressure of atm. layers 46 REAL*8,INTENT(IN) :: zufi_omp(klon,llm) ! zonal wind (m/s) 47 REAL*8,INTENT(IN) :: zvfi_omp(klon,llm) ! meridional wind (m/s) 48 REAL*8,INTENT(INOUT) :: zrfi_omp(klon,llm) ! relative wind vorticity, in s-1 49 REAL*8,INTENT(IN) :: ztfi_omp(klon,llm) ! temperature (K) 50 REAL*8,INTENT(IN) :: zqfi_omp(klon,llm,nqtot) ! tracers (*/kg of air) 51 REAL*8,INTENT(IN) :: flxwfi_omp(klon,llm) ! Vertical mass flux on lower mesh interfaces (kg/s) 50 52 ! tendencies (in */s) from the physics: 51 REAL*4,INTENT(OUT) :: zdufi_omp(klon,llm) ! tendency on zonal winds 52 REAL*4,INTENT(OUT) :: zdvfi_omp(klon,llm) ! tendency on meridional winds 53 REAL*4,INTENT(OUT) :: zdtfi_omp(klon,llm) ! tendency on temperature 54 REAL*4,INTENT(OUT) :: zdqfi_omp(klon,llm,nqtot) ! tendency on tracers 55 REAL*4,INTENT(OUT) :: zdpsrf_omp(klon) ! tendency on surface pressure 53 REAL*8,INTENT(OUT) :: zdufi_omp(klon,llm) ! tendency on zonal winds 54 REAL*8,INTENT(OUT) :: zdvfi_omp(klon,llm) ! tendency on meridional winds 55 REAL*8,INTENT(OUT) :: zdtfi_omp(klon,llm) ! tendency on temperature 56 REAL*8,INTENT(OUT) :: zdqfi_omp(klon,llm,nqtot) ! tendency on tracers 57 REAL*8,INTENT(OUT) :: zdpsrf_omp(klon) ! tendency on surface pressure 58 REAL*8 :: zplevmoy(llm+1) ! planet-averaged mean pressure (Pa) at interfaces 59 REAL*8 :: ztmoy(llm) 56 60 57 61 ! ! Local variables … … 77 81 78 82 ! Set dummy variables for Mars to zero (additional and prob useless security) 79 zpk_omp=(zplay_omp/p0)**rcp 80 zphis_omp(:)=zphi_omp(1,1) 83 ! NB: tname already filled with tracers' names (though not used here) 84 zpk_omp(1:klon,1:llm)=cp*((zplay_omp(1:klon,1:llm)/p0)**rcp) 85 !print*,'zpk_omp',zpk_omp(1,:) 86 zphis_omp(1:klon)=zphi_omp(1:klon,1) 81 87 presnivs_omp(:)=0. 82 88 zrfi_omp(:,:)=0. 89 ztmoy(:)=ztfi_omp(1,:) 90 zplevmoy(:)=zplev_omp(1,:) 83 91 ! Call physics package with required inputs/outputs 84 92 CALL physiq(klon, & … … 101 109 zqfi_omp, & 102 110 flxwfi_omp, & 111 zplevmoy, & 112 ztmoy, & 103 113 zdufi_omp, & 104 114 zdvfi_omp, & … … 106 116 zdqfi_omp, & 107 117 zdpsrf_omp) 108 118 deallocate(tmoy) 109 119 END SUBROUTINE call_physiq 110 120 -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_venus_lmd_new/iniphysiq_mod.F
r1596 r1724 10 10 ! dtphys,daysec,day_ini,hour_ini 11 11 use comconst_mod, only : cpp 12 use cpdet_ mod, only: cpdet,ini_cpdet12 use cpdet_phy_mod, only: init_cpdet_phy 13 13 USE control_mod, ONLY: planet_type 14 14 !use surfdat_h, only: ini_surfdat_h … … 18 18 use dimphy, only: init_dimphy 19 19 USE phys_state_var_mod 20 20 use module_model_constants, only : nu, TT00 21 21 implicit none 22 22 … … 27 27 REAL,intent(in) :: punjours 28 28 !DOUBLE PRECISION,intent(in) :: ptimestep 29 REAL ,intent(in) :: phour_ini29 REAL*8,intent(in) :: phour_ini 30 30 31 31 !real,intent(in) :: prad ! radius of the planet (m) … … 35 35 !real,intent(in) :: punjours ! length (in s) of a standard day [daysec] 36 36 integer,intent(in) :: pdayref ! reference day of for the simulation [day_ini] 37 real* 4,intent(in) :: ptimestep !physics time step (s) [dtphys]37 real*8,intent(in) :: ptimestep !physics time step (s) [dtphys] 38 38 integer,intent(in) :: iflag_phys ! type of physics to be called 39 39 … … 43 43 !real,intent(in) :: phour_ini ! start time (fraction of day) of the run 0=<phour_ini<1 44 44 real,intent(in) :: piphysiq ! call physics every piphysiq dynamical timesteps 45 45 real*8 :: CPPP,nuvenus,T0venus 46 46 47 47 ! copy some fundamental parameters to physics … … 81 81 cpp=pcpp 82 82 planet_type="venus" 83 call ini_cpdet 83 CPPP=pcpp 84 nuvenus=nu 85 T0venus=TT00 86 call init_cpdet_phy(CPPP,nuvenus,T0venus) 84 87 85 88 !! a few time constants initialization -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_venus_lmd_new/update_inputs_physiq_mod.F
r1634 r1724 1 1 MODULE update_inputs_physiq_mod 2 3 IMPLICIT NONE4 5 CHARACTER(len=20),save,allocatable,dimension(:) :: traceurs ! tracer names6 2 7 3 CONTAINS … … 17 13 !SUBROUTINE update_inputs_physiq_slope 18 14 15 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 16 17 18 !c Returns solar longitude, Ls (in deg.), from day number (in sol), 19 !c where sol=0=Ls=0 at the northern hemisphere spring equinox 20 21 22 !!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 19 23 20 24 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 31 35 REAL, INTENT(IN) :: GMT,elaps,lon_input,ls_input,lct_input 32 36 REAL,INTENT(OUT) :: MY 33 REAL ,INTENT(OUT) :: ptime,pday37 REAL*8,INTENT(OUT) :: ptime,pday 34 38 35 39 ! 36 40 ! specified 37 41 ! 38 ptime = (GMT + elaps/3700.) !! universal time (0<ptime<1): ptime=0.5 at 12:00 UT 42 IF (JULYR .ne. 9999) THEN 43 ptime = (GMT + elaps/420000.) !! universal time (0<ptime<1): ptime=0.5 at 12:00 UT 39 44 ptime = MODULO(ptime,24.) !! the two arguments of MODULO must be of the same type 40 45 ptime = ptime / 24. 41 pday = (JULDAY - 1 + INT((3700*GMT+elaps)/88800)) 46 pday = (JULDAY - 1 + INT((420000.0*GMT+elaps)/1.008e7)) 47 pday = MODULO(int(pday),2) 48 MY = (JULYR-2000) + (1.008e7*(JULDAY - 1)+420000.0*GMT+elaps)/2.016e7 49 MY = INT(MY) 50 ELSE 51 ptime = lct_input - lon_input / 15. + elaps/(4200.) 52 ptime = MODULO(ptime,2808.) 53 ptime = ptime / 2808. 54 print*,'ptime',ptime 42 55 pday = MODULO(int(pday),669) 43 MY = (JULYR-2000) + (88800.*(JULDAY - 1)+3700.*GMT+elaps)/59496000.44 MY = INT(MY)56 MY = 2024 57 ENDIF 45 58 46 59 END SUBROUTINE update_inputs_physiq_time … … 48 61 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 49 62 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 50 SUBROUTINE update_inputs_physiq_tracers(nq,MARS_MODE )63 SUBROUTINE update_inputs_physiq_tracers(nq,MARS_MODE,tname) 51 64 52 65 !use infotrac … … 54 67 implicit none 55 68 INTEGER, INTENT(IN) :: nq,MARS_MODE 56 57 ALLOCATE(traceurs(nq)) 58 t raceurs(:)='zolbxs'69 CHARACTER(len=*), INTENT(INOUT) :: tname(nq) ! tracer names 70 71 tname(:)='zolbxs' 59 72 !call infotrac_init ! Need traceur.def 60 73 … … 93 106 ips,ipe,jps,jpe,& 94 107 JULYR,ngrid,nlayer,& 95 D X,DY,MSFT,&108 DDX,DDY,MSFT,& 96 109 lat_input, lon_input,& 97 110 XLAT,XLONG) … … 105 118 USE geometry_mod, ONLY: latitude,latitude_deg,& 106 119 longitude,longitude_deg,& 107 cell_area 120 cell_area,dx,dy 108 121 109 122 implicit none … … 113 126 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: & 114 127 MSFT,XLAT,XLONG 115 REAL, INTENT(IN) :: d x,dy128 REAL, INTENT(IN) :: ddx,ddy 116 129 REAL, INTENT(IN) :: lat_input, lon_input 117 130 INTEGER :: i,j,subs … … 130 143 !----------------------------------------! 131 144 !parea(subs) = dx*dy !! 1. idealized cases - computational grid 132 parea(subs) = (d x/msft(i,j))*(dy/msft(i,j)) !! 2. WRF map scale factors - assume that msfx=msfy (msf=covariance)145 parea(subs) = (ddx/msft(i,j))*(ddy/msft(i,j)) !! 2. WRF map scale factors - assume that msfx=msfy (msf=covariance) 133 146 !parea(subs)=dx*dy/msfu(i,j) !! 3. special for Mercator GCM-like simulations 134 147 … … 167 180 IF(.not.ALLOCATED(latitude_deg)) ALLOCATE(latitude_deg(ngrid)) 168 181 IF(.not.ALLOCATED(cell_area)) ALLOCATE(cell_area(ngrid)) 182 IF (.not.ALLOCATED(dx)) ALLOCATE(dx(ngrid)) 183 IF (.not.ALLOCATED(dy)) ALLOCATE(dy(ngrid)) 169 184 longitude(:) = plon(:) 170 185 latitude(:) = plat(:) … … 184 199 M_ALBEDO,CST_AL,& 185 200 M_TSURF,M_EMISS,M_CO2ICE,& 186 M_GW,M_Z0, CST_Z0,&201 M_GW,M_Z0,& 187 202 M_H2OICE,& 188 203 phisfi_val) … … 195 210 INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,JULYR,MARS_MODE 196 211 INTEGER :: i,j,subs,nlast 197 REAL, INTENT(IN ) :: CST_AL, phisfi_val , CST_Z0212 REAL, INTENT(IN ) :: CST_AL, phisfi_val 198 213 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: & 199 214 M_ALBEDO,M_TSURF,M_EMISS,M_CO2ICE,M_H2OICE,M_Z0 … … 334 349 M_Q2,M_WSTAR) 335 350 336 !use turb_mod, only: q2,wstar,turb_resolved351 use turb_mod, only: q2,wstar,turb_resolved 337 352 338 353 implicit none … … 340 355 INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme 341 356 INTEGER, INTENT(IN) :: ips,ipe,jps,jpe 342 INTEGER :: i,j,subs,nlast 357 INTEGER :: i,j,subs,nlast 343 358 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: M_WSTAR 344 359 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(IN) :: M_Q2 345 360 LOGICAL, INTENT(IN ) :: RESTART,isles 346 361 347 !! Nothing is done 362 turb_resolved =.true. 363 print*,'turb_resolved :',isles 364 365 DO j = jps,jpe 366 DO i = ips,ipe 367 368 !-----------------------------------! 369 ! 1D subscript for physics "cursor" ! 370 !-----------------------------------! 371 subs = (j-jps)*(ipe-ips+1)+(i-ips+1) 372 373 !PBL wind variance 374 IF (.not. restart) THEN 375 q2(subs,:) = 1.E-6 376 wstar(subs)=0. 377 ELSE 378 q2(subs,:)=M_Q2(i,:,j) 379 wstar(subs)=M_WSTAR(i,j) 380 ENDIF 381 382 ENDDO 383 ENDDO 384 385 !!---------------------!! 386 !! OUTPUT FOR CHECKING !! 387 !!---------------------!! 388 nlast = (ipe-ips+1)*(jpe-jps+1) 389 print*,"check: q2",q2(1,1),q2(nlast,kme+1) 390 print*,"check: wstar",wstar(1),wstar(nlast) 348 391 349 392 END SUBROUTINE update_inputs_physiq_turb -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_venus_lmd_new/update_outputs_physiq_mod.F
r1596 r1724 118 118 SUBROUTINE update_outputs_physiq_turb( & 119 119 ims,ime,jms,jme,kms,kme,& 120 ips,ipe,jps,jpe, &120 ips,ipe,jps,jpe,kps,kpe,& 121 121 M_Q2,M_WSTAR,& 122 122 HFMAX,ZMAX,USTM,HFX) 123 123 124 !use turb_mod, only: q2,wstar,ustar,sensibFlux,&124 use turb_mod, only: q2,wstar,yustar,sens!,& 125 125 ! hfmax_th,zmax_th 126 126 … … 128 128 129 129 INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme 130 INTEGER, INTENT(IN) :: ips,ipe,jps,jpe 131 INTEGER :: i,j,subs 130 INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,kps,kpe 131 INTEGER :: i,j,subs 132 132 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: & 133 133 M_WSTAR,HFMAX,ZMAX,USTM,HFX 134 134 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT) :: M_Q2 135 135 136 DO j = jps,jpe 137 DO i = ips,ipe 138 139 !-----------------------------------! 140 ! 1D subscript for physics "cursor" ! 141 !-----------------------------------! 142 subs = (j-jps)*(ipe-ips+1)+(i-ips+1) 143 144 !-------------------------------------------------------! 145 ! Save key variables for restart and output and nesting ! 146 !-------------------------------------------------------! 147 M_Q2(i,kps:kpe+1,j) = q2(subs,:) 148 M_WSTAR(i,j) = wstar(subs) 149 150 !! output only (arrays already in phys modules) 151 !HFMAX(i,j) = HFMAX_TH(subs) 152 !ZMAX(i,j) = ZMAX_TH(subs) 153 USTM(i,j) = yustar(subs) 154 HFX(i,j) = sens(subs) 155 156 ENDDO 157 ENDDO 136 158 137 159 END SUBROUTINE update_outputs_physiq_turb … … 144 166 SWDOWNZ,TAU_DUST,QSURFDUST,& 145 167 MTOT,ICETOT,TAU_ICE,& 146 HR_SW,HR_LW, &168 HR_SW,HR_LW,HR_DYN,DT,DTRAD,DTVDF,DTAJS,& 147 169 RDUST,VMR_ICE,RICE) 148 170 … … 155 177 MTOT,ICETOT,TAU_ICE 156 178 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: & 157 HR_SW,HR_LW, RDUST,VMR_ICE,RICE179 HR_SW,HR_LW,HR_DYN,RDUST,VMR_ICE,RICE,DT,DTRAD,DTVDF,DTAJS 158 180 INTEGER :: i,j,subs 159 181 … … 171 193 HR_SW(i,kps:kpe,j) = comm_HR_SW(subs,kps:kpe) 172 194 HR_LW(i,kps:kpe,j) = comm_HR_LW(subs,kps:kpe) 195 HR_DYN(i,kps:kpe,j) = comm_HR_DYN(subs,kps:kpe) 196 DT(i,kps:kpe,j) = comm_DT(subs,kps:kpe) 197 DTRAD(i,kps:kpe,j) = comm_DT_RAD(subs,kps:kpe) 198 DTVDF(i,kps:kpe,j) = comm_DT_VDF(subs,kps:kpe) 199 DTAJS(i,kps:kpe,j) = comm_DT_AJS(subs,kps:kpe) 173 200 174 201 ENDDO -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_void_lmd_new/update_outputs_physiq_mod.F
r1590 r1724 71 71 SWDOWNZ,TAU_DUST,QSURFDUST,& 72 72 MTOT,ICETOT,TAU_ICE,& 73 HR_SW,HR_LW, &73 HR_SW,HR_LW,HR_DYN,DT,DTRAD,DTVDF,DTAJS,& 74 74 RDUST,VMR_ICE,RICE) 75 75 … … 80 80 MTOT,ICETOT,TAU_ICE 81 81 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: & 82 HR_SW,HR_LW,RDUST,VMR_ICE,RICE 82 HR_SW,HR_LW,RDUST,VMR_ICE,RICE,HR_DYN,DT,DTRAD,DTVDF,DTAJS 83 83 INTEGER :: i,j,subs 84 84 -
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 !! -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/share/Makefile
r11 r1724 17 17 module_optional_si_input.o \ 18 18 module_compute_geop.o \ 19 module_soil_pre.o 19 module_soil_pre.o \ 20 cpdet_mod.o 20 21 21 22 OBJS = \ -
trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/share/module_model_constants.F
r1604 r1724 8 8 9 9 ! A really small number. 10 10 character(len=15) :: planet 11 11 REAL , PARAMETER :: epsilon = 1.E-15 12 12 … … 183 183 REAL :: z_scale ! scale height 184 184 185 REAL :: TT00 186 REAL :: nu 185 187 CONTAINS 186 188 SUBROUTINE init_planet_constants 187 189 IMPLICIT NONE 188 character(len=15) :: planet189 190 Call initial_config 190 planet=model_config_rec%planet191 191 !write(*,*) "unknown planet type", planet 192 192 !stop … … 239 239 wvolcapa = 1.e6 ! volumetric capacity of soil (new soil model) 240 240 #endif 241 TT00=0. 242 nu=0. 241 243 !#endif 242 244 ELSE if ( planet == "venus") then … … 255 257 womeg = 0.2992549E-06 256 258 wdaysec = 0.1008707E08 259 TT00=460. 260 nu=0.35 257 261 ELSE if ( planet == "prescribed") then 258 262 open(17,file='planet_constant',form='formatted',status='old') … … 268 272 p1000mb=p0 269 273 reradius=1./rad 274 TT00=0. 275 nu=0. 270 276 Else 271 277 write(*,*) "unknown planet type:", planet … … 295 301 write(*,*) "t0 = ", t0 296 302 write(*,*) "p0 = ", p0 303 write(*,*) "T0 = ", TT00 304 write(*,*) "nu = ", nu 297 305 END SUBROUTINE init_planet_constants 298 306 END MODULE module_model_constants
Note: See TracChangeset
for help on using the changeset viewer.