Changeset 2529


Ignore:
Timestamp:
May 30, 2016, 10:46:40 PM (8 years ago)
Author:
oboucher
Message:

Reviewing the way swaero_diag is computed to correct an old bug that
makes topswad and co diagnostics wrong for the first timestep...
And introducing swaero_diag in rrtm/recmwf_aero so that double and
triple radiation calls when diagnostics are not needed to save time

Location:
LMDZ5/trunk/libf/phylmd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/iophy.F90

    r2429 r2529  
    633633    ENDIF
    634634
    635     ! Set swaero_diag=true if at least one of the concerned variables are defined
    636     IF (var%name=='topswad' .OR. var%name=='topswai' .OR. var%name=='solswad' .OR. var%name=='solswai' ) THEN
     635    ! Set swaero_diag=true if at least one of the concerned variables are
     636    ! defined
     637    !--OB 30/05/2016 use wider set of variables
     638    IF ( var%name=='topswad' .OR. var%name=='topswad0' .OR. var%name=='solswad' .OR. var%name=='solswad0' .OR. &
     639         var%name=='topswai' .OR. var%name=='solswai'  .OR. ( iflag_rrtm==1 .AND. (                            &
     640         var%name=='toplwad' .OR. var%name=='toplwad0' .OR. var%name=='sollwad' .OR. var%name=='sollwad0' .OR. &
     641         var%name=='toplwai' .OR. var%name=='sollwai'  ) ) ) THEN
    637642       IF  ( var%flag(iff)<=lev_files(iff) ) THEN
    638643          swaero_diag=.TRUE.
  • LMDZ5/trunk/libf/phylmd/phys_output_var_mod.F90

    r2341 r2529  
    4747
    4848  ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
    49   LOGICAL, SAVE                                :: swaero_diag=.FALSE.
     49  !--OB: this needs to be set to TRUE by default and changed back to FALSE after first radiation call
     50  !--    and corrected back to TRUE based on output requests
     51  LOGICAL, SAVE                                :: swaero_diag=.TRUE.
    5052  !$OMP THREADPRIVATE(swaero_diag)
    5153
  • LMDZ5/trunk/libf/phylmd/physiq_mod.F90

    r2525 r2529  
    35133513               ZSWFT0_i, ZFSDN0, ZFSUP0)
    35143514
     3515          !--OB 30/05/2016
     3516          !--here we return swaero_diag to FALSE
     3517          !--and histdef will switch it back to TRUE if necessary
     3518          !--this is necessary to get the right swaero at first step
     3519          IF (debut) swaero_diag = .FALSE.
    35153520          !
    35163521          !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
  • LMDZ5/trunk/libf/phylmd/rrtm/recmwf_aero.F90

    r2146 r2529  
    161161IMPLICIT NONE
    162162INCLUDE "clesphys.h"
    163 
    164163
    165164INTEGER(KIND=JPIM),INTENT(IN)    :: KPROMA
     
    306305! not ok_ade and not ok_aie = 1 to proceed
    307306! therefore the cases have the following corresponding switches
    308 ! 1 = not ok_ade or not ok_aie
    309 ! 2 = ok_aie
    310 ! 3 = ok_ade
     307! 1 = not ok_ade and not ok_aie OR not ok_ade and ok_aie and swaero_diag OR ok_ade and not ok_aie and swaero_diag
     308! 2 = not ok_ade and ok_aie OR ok_aie and ok_ade and swaero_diag
     309! 3 = ok_ade and not ok_aie OR ok_aie and ok_ade and swaero_diag
    311310! 4 = ok_ade and ok_aie
    312311! 5 = no aerosol feedback wanted or no aerosol at all
     
    445444IF (flag_aerosol .GT. 0 .OR. flag_aerosol_strat) THEN
    446445
    447 IF ( .not. ok_ade .or. .not. ok_aie ) THEN
     446!--Case 1
     447IF ( ( .not. ok_ade .AND. .not. ok_aie ) .OR.             &
     448   & ( .not. ok_ade .AND. ok_aie .AND. swaero_diag ) .OR. &
     449   & ( ok_ade .AND. .not. ok_aie .AND. swaero_diag ) ) THEN
    448450
    449451! natural aerosols for direct and indirect effect
     
    483485ENDIF
    484486
    485 IF (ok_aie) THEN
     487!--Case 2
     488IF ( ( .not. ok_ade .AND. ok_aie ) .OR. &
     489   & ( ok_ade .AND. ok_aie .AND. swaero_diag ) ) THEN
    486490
    487491! natural aerosols for direct indirect effect
     
    521525ENDIF ! ok_aie     
    522526
    523 IF (ok_ade) THEN
     527!--Case 3
     528IF ( ( ok_ade .AND. .not. ok_aie ) .OR. &
     529   & ( ok_ade .AND. ok_aie .AND. swaero_diag ) ) THEN
    524530
    525531! direct effect of total aerosol activated
     
    559565ENDIF !-end ok_ade
    560566
     567!--Case 4
    561568IF (ok_ade .and. ok_aie) THEN
    562569
Note: See TracChangeset for help on using the changeset viewer.