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

Update of module_initialize_les.F : add of log interpolation, implementation of dynamics heating rate for Venus and prescribed planet and altitude interpolation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_initialize_les.F

    r1746 r1749  
    116116 ! for mode 3
    117117 REAL, DIMENSION(nl_max) :: profdustq,profdustn
    118  REAL, DIMENSION(nl_max) :: prescribed_sw,prescribed_lw
     118 REAL, DIMENSION(nl_max) :: prescribed_sw,prescribed_lw,prescribed_dyn
     119 REAL, DIMENSION(nl_max) :: hrsw,hrlw,hrdyn
     120 REAL, DIMENSION(nl_max) :: venus_hrdyn
     121 REAL, DIMENSION(nl_max) :: altitude
    119122!!MARS
    120123
     
    123126      !INTEGER :: hypsometric_opt = 2 ! Wee et al. 2012 correction
    124127
    125 character(len=10) :: planet
    126128
    127129#ifdef DM_PARALLEL
    128130#    include <data_calls.inc>
    129131#endif
    130  
    131    call init_planet_constants
    132132
    133133   SELECT CASE ( model_data_order )
     
    393393  DO j=max(ys,jds),min(ye,jde-1)
    394394  DO i=max(xs,ids),min(xe,ide-1)
    395      grid%ht(i,j) = mtn_ht * 0.25 * &
     395     grid%ht(i,j) = alt_input + mtn_ht * 0.25 * &
    396396               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) ) * &
    397397               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
     
    434434      p_level = grid%znu(k)*(p_surf - grid%p_top) + grid%p_top
    435435      grid%pb(i,k,j) = p_level
    436       grid%t_init(i,k,j) = interp_0( theta, p_in, p_level, nl_in ) - t0
     436      grid%t_init(i,k,j) = interp_0_log( theta, p_in, p_level, nl_in ) - t0
    437437      grid%alb(i,k,j) = (r_d/p1000mb)*(grid%t_init(i,k,j)+t0)*(grid%pb(i,k,j)/p1000mb)**cvpm
    438438    ENDDO
     
    458458  ENDDO
    459459  ENDDO
    460 
    461460  IF ( wrf_dm_on_monitor() ) THEN
    462461    write(6,*) ' ptop is ',grid%p_top
     
    491490      p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
    492491
    493       moist(i,k,j,P_QV) = interp_0( qv, pd_in, p_level, nl_in )
    494       grid%t_1(i,k,j)          = interp_0( theta, pd_in, p_level, nl_in ) - t0
     492      moist(i,k,j,P_QV) = interp_0_log( qv, pd_in, p_level, nl_in )
     493      grid%t_1(i,k,j)          = interp_0_log( theta, pd_in, p_level, nl_in ) - t0
    495494      grid%t_2(i,k,j)          = grid%t_1(i,k,j)
    496495     
     
    694693    DO K = 1, kte-1
    695694      p_level = grid%znu(k)*(p_surf - grid%p_top) + grid%p_top
    696       grid%v_1(i,k,j) = interp_0( v, p_in, p_level, nl_in )
     695      grid%v_1(i,k,j) = interp_0_log( v, p_in, p_level, nl_in )
    697696      grid%v_2(i,k,j) = grid%v_1(i,k,j)
    698697    ENDDO
     
    718717    DO K = 1, kte-1
    719718      p_level = grid%znu(k)*(p_surf - grid%p_top) + grid%p_top
    720       grid%u_1(i,k,j) = interp_0( u, p_in, p_level, nl_in )
     719      grid%u_1(i,k,j) = interp_0_log( u, p_in, p_level, nl_in )
    721720      grid%u_2(i,k,j) = grid%u_1(i,k,j)
    722721    ENDDO
     
    847846      DO k=1,kte-1
    848847         p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
    849          scalar(its:ite,k,jts:jte,2) = interp_0( qv, pd_in, p_level, nl_in )
     848         scalar(its:ite,k,jts:jte,2) = interp_0_log( qv, pd_in, p_level, nl_in )
    850849         scalar(its:ite,k,jts:jte,3) = 0.
    851850           !! water ice is set to 0 (was put into water vapor when building prof from MCD)
     
    862861      DO k=1,kte-1
    863862         p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
    864          scalar(its:ite,k,jts:jte,4) = interp_0( profdustq, pd_in, p_level, nl_in )
    865          scalar(its:ite,k,jts:jte,5) = interp_0( profdustn, pd_in, p_level, nl_in )
     863         scalar(its:ite,k,jts:jte,4) = interp_0_log( profdustq, pd_in, p_level, nl_in )
     864         scalar(its:ite,k,jts:jte,5) = interp_0_log( profdustn, pd_in, p_level, nl_in )
    866865      ENDDO
    867866      print *, "DUST Q", scalar(its,:,jts,4)
     
    882881       DO i = its, ite
    883882         !!! we use Q2 as a vehicle for heating rates! sick!
    884          grid%m_q2(i,k,j) = interp_0( profdustq, pd_in, p_level, nl_in ) &
    885                           + interp_0( profdustn, pd_in, p_level, nl_in )
     883         grid%m_q2(i,k,j) = interp_0_log( profdustq, pd_in, p_level, nl_in ) &
     884                          + interp_0_log( profdustn, pd_in, p_level, nl_in )
    886885       ENDDO
    887886       ENDDO
     
    889888       !print*,k,grid%m_q2(1,k,1)
    890889    ENDDO
    891     print*,'planet',planet   
     890
    892891    IF (planet.eq."prescribed") Then
    893       call read_hr(profdustq,profdustn,nl_in)
     892      call read_hr(hrsw,hrlw,hrdyn,nl_in)
    894893      open(unit=17,file="prescribed_sw.txt",action="write")
    895894      open(unit=18,file="prescribed_lw.txt",action="write")
     895      open(unit=19,file="prescribed_dyn.txt",action="write")
    896896      DO k=1,kte!-1
    897897        p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
    898         prescribed_sw(k) = interp_0( profdustq, pd_in, p_level, nl_in )
    899         prescribed_lw(k) = interp_0( profdustn, pd_in, p_level, nl_in )
     898        prescribed_sw(k) = interp_0_log( hrsw, pd_in, p_level, nl_in )
     899        prescribed_lw(k) = interp_0_log( hrlw, pd_in, p_level, nl_in )
     900        prescribed_dyn(k) = interp_0_log( hrdyn, pd_in, p_level, nl_in )
    900901        write (17,*) prescribed_sw(k)
    901902        write (18,*) prescribed_lw(k)
     903        write (19,*) prescribed_dyn(k)
    902904      ENDDO
     905      close(unit=19)
     906      close(unit=18)
    903907      close(unit=17)
    904       close(unit=18)
    905908    ENDIF
     909   
     910    IF (planet.eq."venus") Then
     911      call read_hr(hrsw,hrlw,hrdyn,nl_in)
     912      open(unit=20,file="venus_hrdyn.txt",action="write")
     913      DO k=1,kte!-1
     914        p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
     915        venus_hrdyn(k) = interp_0_log( hrdyn, pd_in, p_level, nl_in )
     916        write (20,*) venus_hrdyn(k)
     917      ENDDO
     918      close(unit=20)
     919    ENDIF
     920
     921    open(unit=21,file="altitude.txt",action="write")
     922    DO k=1,kte!-1
     923      p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
     924      altitude(k) = interp_0_log( zk, pd_in, p_level, nl_in )
     925      write (21,*) altitude(k)
     926    ENDDO
     927    close(unit=21)
    906928
    907929!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    11981220      implicit none
    11991221      integer n
    1200       real pdustq(n),pdustn(n)
     1222      real pdustq(n+1),pdustn(n+1)
    12011223      logical end_of_file
    12021224
     
    12231245      end subroutine read_dust
    12241246!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
    1225       subroutine read_hr(hr_sw,hr_lw,n)
     1247      subroutine read_hr(hr_sw,hr_lw,hr_dyn,n)
    12261248      implicit none
    12271249      integer n
    1228       real hr_sw(n),hr_lw(n)
     1250      real hr_sw(n+1),hr_lw(n+1),hr_dyn(n+1)
    12291251      logical end_of_file
    12301252
     
    12391261      do while (.not. end_of_file)
    12401262
    1241         read(11,*,end=103) hr_sw(k+1),hr_lw(k+1)
    1242         write(*,*) k,hr_sw(k+1),hr_lw(k+1)
     1263        read(11,*,end=103) hr_sw(k+1),hr_lw(k+1),hr_dyn(k+1)
     1264        write(*,*) k,hr_sw(k+1),hr_lw(k+1),hr_dyn(k+1)
    12431265        k = k+1
    1244         go to 113
     1266        go to 114
    12451267 103    end_of_file = .true.
    12461268 114    continue
Note: See TracChangeset for help on using the changeset viewer.