Index: palm/trunk/SOURCE/biometeorology_mod.f90
===================================================================
--- palm/trunk/SOURCE/biometeorology_mod.f90	(revision 4126)
+++ palm/trunk/SOURCE/biometeorology_mod.f90	(revision 4127)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! Output for bio_mrt added (merge from branch resler)
+! 
+! 4126 2019-07-30 11:09:11Z gronemeier
 ! renamed vitd3_exposure_av into vitd3_dose,
 ! renamed uvem_calc_exposure into bio_calculate_uv_exposure
@@ -226,4 +229,5 @@
     LOGICAL ::  average_trigger_utci   = .FALSE.  !< update averaged input on call to bio_utci?
     LOGICAL ::  average_trigger_pet    = .FALSE.  !< update averaged input on call to bio_pet?
+    LOGICAL ::  average_trigger_mrt    = .FALSE.  !< update averaged input on call to bio_pet?
     LOGICAL ::  do_calculate_perct     = .FALSE.  !< Turn index PT (instant. input) on or off
     LOGICAL ::  do_calculate_perct_av  = .FALSE.  !< Turn index PT (averaged input) on or off
@@ -232,4 +236,5 @@
     LOGICAL ::  do_calculate_utci      = .FALSE.  !< Turn index UTCI (instant. input) on or off
     LOGICAL ::  do_calculate_utci_av   = .FALSE.  !< Turn index UTCI (averaged input) on or off
+    LOGICAL ::  do_calculate_mrt2d     = .FALSE.  !< Turn index MRT 2D (averaged or inst) on or off
 
 !
@@ -432,5 +437,5 @@
 
 
-          CASE ( 'bio_perct*', 'bio_utci*', 'bio_pet*' )
+          CASE ( 'bio_perct*', 'bio_utci*', 'bio_pet*', 'bio_mrt*' )
 
 !
@@ -447,5 +452,6 @@
              IF ( .NOT. average_trigger_perct  .AND.                           &
                   .NOT. average_trigger_utci   .AND.                           &
-                  .NOT. average_trigger_pet )  THEN
+                  .NOT. average_trigger_pet    .AND.                           &
+                  .NOT. average_trigger_mrt )  THEN
 !
 !--             Memorize the first index called to control averaging
@@ -458,4 +464,7 @@
                 IF ( TRIM( variable ) == 'bio_pet*' )  THEN
                     average_trigger_pet = .TRUE.
+                ENDIF
+                IF ( TRIM( variable ) == 'bio_mrt*' )  THEN
+                    average_trigger_mrt = .TRUE.
                 ENDIF
              ENDIF
@@ -499,5 +508,5 @@
              ENDIF
 
-          CASE ( 'bio_perct*', 'bio_utci*', 'bio_pet*' )
+          CASE ( 'bio_perct*', 'bio_utci*', 'bio_pet*', 'bio_mrt*' )
 !
 !--          Only continue if the current index is the one to trigger the input 
@@ -509,4 +518,6 @@
              IF ( average_trigger_pet    .AND.  TRIM( variable ) /=            &
                 'bio_pet*')    RETURN
+             IF ( average_trigger_mrt    .AND.  TRIM( variable ) /=            &
+                'bio_mrt*')    RETURN
 !
 !--          Now memorize which of the input grids are not averaged by other 
@@ -637,5 +648,5 @@
              ENDIF
 
-          CASE ( 'bio_perct*', 'bio_utci*', 'bio_pet*' )
+          CASE ( 'bio_perct*', 'bio_utci*', 'bio_pet*', 'bio_mrt*' )
 !
 !--          Only continue if update index, see above
@@ -646,4 +657,6 @@
              IF ( average_trigger_pet   .AND.                                  &
                 TRIM( variable ) /= 'bio_pet*' )  RETURN
+             IF ( average_trigger_mrt   .AND.                                  &
+                TRIM( variable ) /= 'bio_mrt*' )  RETURN
 
              IF ( ALLOCATED( pt_av )  .AND.  do_average_theta )  THEN
@@ -748,5 +761,5 @@
 !--    derived in a single step based on priorly averaged arrays (see
 !--    bio_calculate_thermal_index_maps).
-       CASE ( 'bio_mrt' )
+       CASE ( 'bio_mrt', 'bio_mrt*' )
           unit = 'degree_C'
           thermal_comfort = .TRUE.  !< enable thermal_comfort if user forgot to do so
@@ -755,4 +768,7 @@
              tmrt_grid = REAL( bio_fill_value, KIND = wp )
           ENDIF
+          IF ( TRIM( var ) == 'bio_mrt*' )  THEN
+             do_calculate_mrt2d = .TRUE.
+          END IF
 
        CASE ( 'bio_perct*' )
@@ -961,4 +977,21 @@
            ENDDO
 
+        CASE ( 'bio_mrt*_xy' )        ! 2d-array
+           grid = 'zu1'
+           two_d = .TRUE.
+           IF ( av == 0 )  THEN
+              DO  i = nxl, nxr
+                 DO  j = nys, nyn
+                    local_pf(i,j,nzb+1) = tmrt_grid(j,i)
+                 ENDDO
+              ENDDO
+           ELSE
+              DO  i = nxl, nxr
+                 DO  j = nys, nyn
+                    local_pf(i,j,nzb+1) = tmrt_av_grid(j,i)
+                 ENDDO
+              ENDDO
+           ENDIF
+
 
         CASE ( 'bio_perct*_xy' )        ! 2d-array
@@ -1372,4 +1405,7 @@
           READ ( 13 )  average_trigger_pet
 
+       CASE ( 'average_trigger_mrt' )
+          READ ( 13 )  average_trigger_mrt
+
 
        CASE DEFAULT
@@ -1451,4 +1487,6 @@
     CALL wrd_write_string( 'average_trigger_pet' )
     WRITE ( 14 )  average_trigger_pet
+    CALL wrd_write_string( 'average_trigger_mrt' )
+    WRITE ( 14 )  average_trigger_mrt
 
  END SUBROUTINE bio_wrd_global
@@ -1694,5 +1732,6 @@
     IF ( do_calculate_perct  .OR.  do_calculate_perct_av  .OR.                 &
        do_calculate_utci  .OR.  do_calculate_utci_av  .OR.                     &
-       do_calculate_pet  .OR.  do_calculate_pet_av )  THEN
+       do_calculate_pet  .OR.  do_calculate_pet_av  .OR.                       &
+       do_calculate_mrt2d )  THEN
 
 !
