Changeset 1750


Ignore:
Timestamp:
Jul 24, 2017, 5:57:02 PM (7 years ago)
Author:
mlefevre
Message:

Update of module_initialize_real : implementation of Venus pressure computation and potential temperature using cp(T)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F

    r1746 r1750  
    118118      REAL :: max_dz
    119119
    120 !      INTEGER , PARAMETER :: nl_max = 1000
     120!     INTEGER , PARAMETER :: nl_max = 1000
    121121!      REAL , DIMENSION(nl_max) :: grid%em_dn
    122122
     
    149149      !LOGICAL :: interp_theta = .false. ! Wee et al. 2012 correction
    150150      REAL :: pfu, pfd, phm
    151 
     151      REAL :: tpot
    152152
    153153#ifdef DM_PARALLEL
     
    10801080!!END DO
    10811081
    1082 
     1082IF ( planet == "mars" ) then
    10831083!--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 )
     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 )
    10911091
    10921092!!! Define old sigma levels for each column
    1093         sig(i,:,j)=grid%em_p_gc(i,:,j)/grid%em_psfc_gc(i,j)
     1093          sig(i,:,j)=grid%em_p_gc(i,:,j)/grid%em_psfc_gc(i,j)
    10941094
    10951095!!! Compute new sigma levels from old sigma levels with GCM (low-res) and WRF (hi-res) surface pressure
    10961096!!!                        (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))
     1097          CALL build_sigma_hr(sizegcm,sig(i,:,j),grid%em_psfc_gc(i,j),grid%psfc(i,j),bp(i,:,j))
    10981098
    10991099!!! Calculate new pressure levels
    1100         grid%em_pd_gc(i,:,j)=bp(i,:,j)*grid%psfc(i,j)
    1101 
    1102 END DO
    1103 END DO
    1104 
    1105 DEALLOCATE(sig)
    1106 DEALLOCATE(bp)
     1100          grid%em_pd_gc(i,:,j)=bp(i,:,j)*grid%psfc(i,j)
     1101
     1102  END DO
     1103  END DO
     1104
     1105  DEALLOCATE(sig)
     1106  DEALLOCATE(bp)
    11071107
    11081108!!****MARS who knows...
    1109 grid%em_rh_gc(:,:,:)=0.
     1109  grid%em_rh_gc(:,:,:)=0.
    11101110
    11111111
     
    11131113!grid%em_pd_gc=grid%em_p_gc
    11141114!!****MARS
    1115 
     1115ELSE ! VENUS
    11161116
    11171117
     
    11201120         !!  dry top pressure (constant).
    11211121         !
    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 
     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 )
     1126ENDIF
     1127IF ( planet == "mars" ) then
    11271128!!****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_top
    1132 
    1133 END DO
    1134 END DO
     1129  DO j = jts , MIN ( jde-1 , jte )
     1130  DO i = its , MIN (ide-1 , ite )
     1131
     1132     grid%em_mu0(i,j) = grid%psfc(i,j) - grid%p_top
     1133
     1134  END DO
     1135  END DO
    11351136!!****MARS
    1136 
     1137ELSE ! VENUS
    11371138   
    11381139         !!  Compute the dry, hydrostatic surface pressure.
    11391140         !
    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 )
     1141           CALL p_dhs ( grid%em_pdhs , grid%ht , p00 , t00 , a , &
     1142                        ids , ide , jds , jde , kds , kde , &
     1143                        ims , ime , jms , jme , kms , kme , &
     1144                        its , ite , jts , jte , kts , kte )
     1145ENDIF
    11441146!!****MARS: voir remarques dans la routine
    11451147!!****MARS: dry hydrostatic pressure comes from the GCM ...
     
    22942296IF (( i .EQ. its ) .AND. ( j .EQ. jts )) print *, temp, k
    22952297!!! 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
     2298               IF (planet .eq. "mars" ) THEN
     2299                 grid%em_t_init(i,k,j) = temp*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0
     2300               ELSE
     2301                 grid%em_t_init(i,k,j) = (temp**nu + nu*(TT00**nu)*log((p00/grid%em_pb(i,k,j))**rcp))**(1/nu) -t0
     2302               ENDIF
    22972303               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
    22982304            END DO
     
    27802786temp1 = MAX(tiso,t00+A*LOG(grid%em_pb(i,k,j)/p00))
    27812787temp2 = 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
     2788IF (planet .eq. "mars" ) THEN
     2789  grid%em_t_init(i,k,j) = temp1*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0
     2790  t_init_int(i,k,j)     = temp2*(p00/pb_int           )**(r_d/cp) - t0
     2791ELSE
     2792  grid%em_t_init(i,k,j) = (temp1**nu + nu*(TT00**nu)*log((p00/grid%em_pb(i,k,j))**(rcp)))**(1/nu) - t0
     2793  t_init_int(i,k,j)     = (temp2**nu + nu*(TT00**nu)*log((p00/pb_int)**(rcp)))**(1/nu) - t0
     2794ENDIF
    27842795               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
    27852796            END DO
     
    49694980!            temp =             t00 + A*LOG(pb/p00)
    49704981temp = 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
    49724987            alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
    49734988         END DO
     
    50055020!            temp =             t00 + A*LOG(pb/p00)
    50065021temp = 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
    50085027            alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
    50095028            znw(k+1) = znw(k) - dz*g / ( mub*alb(k) )
     
    50255044!                  temp =             t00 + A*LOG(pb/p00)
    50265045temp = 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
    50285051                  alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
    50295052                  znw(k+1) = znw(k) - dz*g / ( mub*alb(k) )
     
    50525075!               temp =             t00 + A*LOG(pb/p00)
    50535076temp = 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
    50555082               alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
    50565083            END DO
Note: See TracChangeset for help on using the changeset viewer.