Ignore:
Timestamp:
May 30, 2019 9:50:11 AM (4 years ago)
Author:
moh.hefny
Message:

Bugfix in check radiation related variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/radiation_model_mod.f90

    r3992 r4008  
    2828! -----------------
    2929! $Id$
     30! Bugfix in check variable when a variable's string is less than 3
     31! characters is processed. All variables now are checked if they
     32! belong to radiation
     33!
     34! 3992 2019-05-22 16:49:38Z suehring
    3035! Bugfix in rrtmg radiation branch in a nested run when the lowest prognistic
    3136! grid points in a child domain are all inside topography
     
    14061411       INTEGER(iwp) :: i, k
    14071412       INTEGER(iwp) :: ilen
    1408        CHARACTER(LEN=varnamelength) :: var          !< TRIM(variable)
     1413       CHARACTER(LEN=varnamelength) :: var  !< TRIM(variable)
    14091414
    14101415       var = TRIM(variable)
     1416
     1417       IF ( len(var) < 3_iwp  )  THEN
     1418          unit = 'illegal'
     1419          RETURN
     1420       ENDIF
     1421
     1422       IF ( var(1:3) /= 'rad'  .AND.  var(1:3) /= 'rtm' )  THEN
     1423          unit = 'illegal'
     1424          RETURN
     1425       ENDIF
    14111426
    14121427!--    first process diractional variables
     
    1053310548
    1053410549    found = .TRUE.
     10550    var = TRIM(variable)
     10551
     10552!-- check if variable belongs to radiation related variables (starts with rad or rtm)
     10553    IF ( len(var) < 3_iwp  )  THEN
     10554       found = .FALSE.
     10555       RETURN
     10556    ENDIF
     10557   
     10558    IF ( var(1:3) /= 'rad'  .AND.  var(1:3) /= 'rtm' )  THEN
     10559       found = .FALSE.
     10560       RETURN
     10561    ENDIF
    1053510562
    1053610563    ids = -1
    10537     var = TRIM(variable)
    1053810564    DO i = 0, nd-1
    1053910565        k = len(TRIM(var))
    1054010566        j = len(TRIM(dirname(i)))
    10541         IF ( TRIM(var(k-j+1:k)) == TRIM(dirname(i)) )  THEN
    10542             ids = i
    10543             idsint_u = dirint_u(ids)
    10544             idsint_l = dirint_l(ids)
    10545             var = var(:k-j)
    10546             EXIT
     10567        IF ( k-j+1 >= 1_iwp ) THEN
     10568           IF ( TRIM(var(k-j+1:k)) == TRIM(dirname(i)) )  THEN
     10569              ids = i
     10570              idsint_u = dirint_u(ids)
     10571              idsint_l = dirint_l(ids)
     10572              var = var(:k-j)
     10573              EXIT
     10574           ENDIF
    1054710575        ENDIF
    1054810576    ENDDO
Note: See TracChangeset for help on using the changeset viewer.