Ignore:
Timestamp:
Apr 7, 2015, 3:41:32 PM (10 years ago)
Author:
aslmd
Message:

cosmetic changes for DUSTSTORM mode (better comments and location of code changes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/aeropacity.F

    r1376 r1410  
    123123      real l_top ! layer of the storm's top
    124124      REAL zalt(ngrid, nlayer) ! useful factor to compute l_top
    125       REAL zdqnorm(ngrid, nlayer,2)
    126125#endif
    127126
     
    459458#ifdef DUSTSTORM
    460459c -----------------------------------------------------------------
    461 c the quantity of dust to add at the first time step is calculated
    462 c to match a tunable opacity perturbation.
     460! Calculate reference opacity without perturbation
    463461c -----------------------------------------------------------------
    464462      IF (firstcall) THEN
     
    472470        ENDDO
    473471        tauref(:) = tauref(:) * odpref / pplev(:,1)
     472
    474473c--------------------------------------------------
    475 c  Parameters of the opacity perturbation
     474c Get parameters of the opacity perturbation
    476475c--------------------------------------------------
    477 
    478       iaer=1  !!!! PROVISOIRE !!!!
     476        iaer=1  ! just change dust
    479477
    480478        write(*,*) "Add a local storm ?"
     
    518516              write(*,*) " reffstorm = ",reffstorm
    519517
     518!! LOOP: modify opacity
    520519      DO ig=1,ngrid
    521520
    522 
    523 c---------------------------------------
    524 c        distance to the center:
    525 c-----------------------------------------
    526 
     521      !! distance to the center:
    527522      ray(ig)=SQRT((lati(ig)*180./pi-latloc)**2 +
    528523     &          (long(ig)*180./pi -lonloc)**2)
    529524
    530 
    531525      !! transition factor for storm
    532       !! increase factor ray diff for steepness
     526      !! factor is hardcoded -- increase it to steepen
    533527      yeah = (TANH(2.+(radloc-ray(ig))*10.)+1.)/2.
    534528
    535 c-------------------------------------------------
    536 c           Tau's new map:
    537 c------------------------------------------
    538 
    539       tauuser(ig)=max(tauref(ig) * pplev(ig,1) /odpref  ,
    540      &          taulocref * yeah)
    541 
    542 c---------------------------------------------------------
    543 c           compute l_top
    544 c----------------------------------------------------------
    545 
     529      !! new opacity field
     530      !! -- add an opacity set to taulocref
     531      !! -- the additional reference opacity will
     532      !!      thus be taulocref*odpref/pplev
     533      tauuser(ig)=max( tauref(ig) * pplev(ig,1) /odpref ,
     534     &          taulocref * yeah )
     535
     536      !! compute l_top
    546537          DO l=1,nlayer
    547538            zalt(ig,l) = LOG( pplev(ig,1)/pplev(ig,l) )
     
    552543          ENDDO
    553544
    554 c---------------------------------------------------------
    555 c           change reffrad if ever needed
    556 c----------------------------------------------------------
    557 
     545     !! change reffrad if ever needed
    558546      IF (reffstorm .gt. 0.) THEN
    559547          DO l=1,nlayer
     
    565553      ENDIF
    566554
    567 
    568 c---------------------------------------------------------------------------
    569       ENDDO !! boucle sur ngridmx
    570 c---------------------------------------------------------------------------
    571 c----------------------------------------------------------------------------
    572 c    compute int_factor
    573 c---------------------------------------------------------------------------
    574 
     555      ENDDO
     556!! END LOOP
     557
     558      !! compute perturbation in each layer (equation 8 in Spiga et al. JGR 2013)
    575559      DO ig=1,ngrid
    576560          int_factor(ig)=0.
     
    585569          ENDDO
    586570          DO l=1, nlayer
    587 
    588 c-------------------------------------------------------------------------
    589 c Mass mixing ratio perturbation due to the local dust storm in each
    590 c layer
    591 c-------------------------------------------------------------------------
     571          !! Mass mixing ratio perturbation due to local dust storm in each layer
    592572          more_dust(ig,l,1)=
    593573     &                     (tauuser(ig)-(tauref(ig)
     
    603583      ENDDO
    604584
    605 c--------------------------------------------------------------------------------------
    606 c   quantity of dust which is added at the first time step
    607 c     in dynamical core.
    608 c--------------------------------------------------------------------------------------
    609 
    610         DO l=1, l_top
    611           zdqnorm(:,l,1) = more_dust(:,l,1)
    612           zdqnorm(:,l,2) = more_dust(:,l,2)
     585      !! quantity of dust for each layer with the addition of the perturbation
     586      DO l=1, l_top
    613587          pq(:,l,igcm_dust_mass)= pq(:,l,igcm_dust_mass)
    614      .            + zdqnorm(:,l,1)
     588     .            + more_dust(:,l,1)
    615589          pq(:,l,igcm_dust_number)= pq(:,l,igcm_dust_number)
    616      .            + zdqnorm(:,l,2)
    617         ENDDO
    618         ENDIF
    619         tauref(:)=0.
    620       ENDIF  !firstcall
     590     .            + more_dust(:,l,2)
     591      ENDDO
     592      ENDIF !! IF (localstorm)
     593      tauref(:)=0.
     594      ENDIF !! IF (firstcall)
    621595#endif
    622596
     
    643617        ENDDO
    644618
    645       ENDIF
     619      ENDIF ! IF (freedust)
    646620
    647621c     Opacity computation
     
    666640          DO l=1,nlayer
    667641            DO ig=1,ngrid
     642#ifdef DUSTSTORM
     643      !! recalculate opacity because storm perturbation has been added
     644      IF (firstcall) THEN
     645              aerosol(ig,l,iaer) =
     646     &          (  0.75 * QREFvis3d(ig,l,iaer) /
     647     &          ( rho_dust * reffrad(ig,l,iaer) )  ) *
     648     &          pq(ig,l,igcm_dust_mass) *
     649     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
     650      ENDIF
     651#endif
    668652              tauref(ig) = tauref(ig) +
    669653     &                    aerosol(ig,l,iaerdust(iaer))
Note: See TracChangeset for help on using the changeset viewer.