Ignore:
Timestamp:
May 30, 2012, 1:29:56 AM (13 years ago)
Author:
aslmd
Message:

MESOSCALE : modifications for restart broke MMM or LES with old physics. now fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F

    r674 r678  
    3333        MARS_TSOIL, &
    3434        MARS_Q2, &
     35        MARS_TSURF, &
     36#ifdef NEWPHYS
    3537        MARS_FLUXRAD, &
    3638        MARS_WSTAR, &
    37         MARS_TSURF, &
    38 #ifdef NEWPHYS
    3939        MARS_ISOIL, &
    4040        MARS_DSOIL, &
     
    123123REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
    124124     MARS_CICE,MARS_WICE, &
    125      MARS_FLUXRAD,MARS_WSTAR,MARS_TSURF
     125     MARS_TSURF
    126126! 3D arrays
    127127REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: &
     
    142142REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN   )  :: &
    143143     MARS_Z0
     144REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
     145     MARS_FLUXRAD,MARS_WSTAR
    144146#endif
    145147REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: &
     
    197199   REAL :: zmea_val,zstd_val,zsig_val,zgam_val,zthe_val
    198200   REAL :: theta_val, psi_val
    199    REAL :: wstar_val,fluxrad_val
    200201   LOGICAL :: firstcall,lastcall,tracerdyn
    201202   REAL,DIMENSION(:),ALLOCATABLE :: q2_val, qsurf_val, tsoil_val
    202203#ifdef NEWPHYS
     204   REAL :: wstar_val,fluxrad_val
    203205   REAL,DIMENSION(:),ALLOCATABLE :: isoil_val, dsoil_val
    204206   REAL :: z0_val
     
    209211   REAL,DIMENSION(:),ALLOCATABLE :: wtheta, wpsi
    210212   ! v--- can they be modified ?
    211    REAL,DIMENSION(:),ALLOCATABLE :: wtsurf,wco2ice,wemis,wwstar,wfluxrad
     213   REAL,DIMENSION(:),ALLOCATABLE :: wtsurf,wco2ice,wemis
    212214   REAL,DIMENSION(:,:),ALLOCATABLE :: wq2,wqsurf,wtsoil
    213215#ifdef NEWPHYS
     216   REAL,DIMENSION(:),ALLOCATABLE :: wwstar,wfluxrad
    214217   REAL,DIMENSION(:),ALLOCATABLE :: wz0tab
    215218   REAL,DIMENSION(:,:),ALLOCATABLE :: wisoil,wdsoil
     
    274277             save_tsurf_restart
    275278      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
    276              save_fluxrad_restart
    277       REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
    278279             save_co2ice_restart
    279280      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
     
    281282      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
    282283             save_qsurf_restart
     284#ifdef NEWPHYS
    283285      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
    284286             save_wstar_restart
     287      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
     288             save_fluxrad_restart
     289#endif
    285290
    286291!!!IDEALIZED IDEALIZED
     
    432437! Restart save arrays
    433438ALLOCATE(save_tsoil_restart(ngrid,nsoil))
    434 ALLOCATE(save_fluxrad_restart(ngrid))
    435439ALLOCATE(save_co2ice_restart(ngrid))
    436440ALLOCATE(save_q2_restart(ngrid,nlayer+1))
    437441ALLOCATE(save_qsurf_restart(ngrid,nq))
    438 ALLOCATE(save_wstar_restart(ngrid))
    439442ALLOCATE(save_tsurf_restart(ngrid))
    440443save_tsoil_restart(:,:)=0.
    441 save_fluxrad_restart(:)=0.
    442444save_co2ice_restart(:)=0.
    443445save_q2_restart(:,:)=0.
    444446save_qsurf_restart(:,:)=0.
     447save_tsurf_restart(:)=0.
     448#ifdef NEWPHYS
     449ALLOCATE(save_wstar_restart(ngrid))
     450ALLOCATE(save_fluxrad_restart(ngrid))
    445451save_wstar_restart(:)=0.
    446 save_tsurf_restart(:)=0.
     452save_fluxrad_restart(:)=0.
     453#endif
    447454
    448455!! put here some general information you'd like to print just once
     
    666673ALLOCATE(wqsurf(ngrid,nq))       !!!!!
    667674ALLOCATE(wtsoil(ngrid,nsoil))    !!!!!
     675#ifdef NEWPHYS
    668676ALLOCATE(wfluxrad(ngrid))
    669677ALLOCATE(wwstar(ngrid))
    670 #ifdef NEWPHYS
    671678ALLOCATE(wisoil(ngrid,nsoil))    !!!!!
    672679ALLOCATE(wdsoil(ngrid,nsoil))    !!!!!
     
    10891096IF (.not. restart) THEN
    10901097   q2_val(:)=0.      !PBL wind variance
     1098#ifdef NEWPHYS
    10911099   fluxrad_val=0.
    10921100   wstar_val=0.
     1101#endif
    10931102ELSE
    10941103   q2_val(:)=MARS_Q2(i,:,j)
     1104#ifdef NEWPHYS
    10951105   fluxrad_val=MARS_FLUXRAD(i,j)
    10961106   wstar_val=MARS_WSTAR(i,j)
     1107#endif
    10971108ENDIF
    10981109
     
    11151126wemis(subs) = emis_val
    11161127wq2(subs,:) = q2_val(:)
     1128wqsurf(subs,:) = qsurf_val(:)
     1129wtsoil(subs,:) = tsoil_val(:)
     1130#ifdef NEWPHYS
    11171131wfluxrad(subs) = fluxrad_val
    11181132wwstar(subs) = wstar_val
    1119 wqsurf(subs,:) = qsurf_val(:)
    1120 wtsoil(subs,:) = tsoil_val(:)
    1121 #ifdef NEWPHYS
    11221133wisoil(subs,:) = isoil_val(:)
    11231134wdsoil(subs,:) = dsoil_val(:)
     
    13431354#endif
    13441355save_tsoil_restart(:,:)=wtsoil(:,:)
    1345 save_fluxrad_restart(:)=wfluxrad(:)
    13461356save_co2ice_restart(:)=wco2ice(:)
    13471357save_q2_restart(:,:)=wq2(:,:)
    13481358save_qsurf_restart(:,:)=wqsurf(:,:)
    1349 save_wstar_restart(:)=wwstar(:)
    13501359save_tsurf_restart(:)=wtsurf(:)
    13511360DEALLOCATE(wtsoil)
    1352 DEALLOCATE(wfluxrad)
    13531361DEALLOCATE(wco2ice)
    13541362DEALLOCATE(wq2)
    13551363DEALLOCATE(wqsurf)
     1364DEALLOCATE(wtsurf)
     1365#ifdef NEWPHYS
     1366save_wstar_restart(:)=wwstar(:)
     1367save_fluxrad_restart(:)=wfluxrad(:)
     1368DEALLOCATE(wfluxrad)
    13561369DEALLOCATE(wwstar)
    1357 DEALLOCATE(wtsurf)
     1370#endif
    13581371ENDIF call_physics
    13591372
     
    14391452! Save key variables for restart ! 
    14401453!------------------------------------!
    1441 
    14421454MARS_TSOIL(i,:,j)=save_tsoil_restart(subs,:)
    1443 MARS_FLUXRAD(i,j)=save_fluxrad_restart(subs)
    14441455MARS_CICE(i,j)=save_co2ice_restart(subs)
    14451456MARS_Q2(i,:,j)=save_q2_restart(subs,:)
    14461457SELECT CASE (MARS_MODE)
    14471458   CASE (1,11,12)
    1448      MARS_WICE(i,j)=save_qsurf_restart(subs,2)
     1459     MARS_WICE(i,j)=save_qsurf_restart(subs,2)  !! see above Tracer at surface
    14491460END SELECT
     1461MARS_TSURF(i,j)=save_tsurf_restart(subs)
     1462#ifdef NEWPHYS
    14501463MARS_WSTAR(i,j)=save_wstar_restart(subs)
    1451 MARS_TSURF(i,j)=save_tsurf_restart(subs)
     1464MARS_FLUXRAD(i,j)=save_fluxrad_restart(subs)
     1465#endif
    14521466
    14531467!---------!
Note: See TracChangeset for help on using the changeset viewer.