Changeset 1853 for palm/trunk/SOURCE


Ignore:
Timestamp:
Apr 11, 2016 9:00:35 AM (9 years ago)
Author:
maronga
Message:

bugfix: radiation_scheme = constant caused model crash when used in combination with land surface model

Location:
palm/trunk/SOURCE
Files:
3 edited

Legend:

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

    r1852 r1853  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Adjusted for use with radiation_scheme = constant
    2222!
    2323! Former revisions:
     
    798798             ENDIF
    799799
    800              IF ( radiation )  THEN
     800             IF ( radiation  .AND.  radiation_scheme /= 'constant' )  THEN
    801801                sums_l(nzb,101,tn)  = sums_l(nzb,101,tn)  + rad_net(j,i)
    802802                sums_l(nzb,102,tn)  = sums_l(nzb,102,tn)  + rad_lw_in(nzb,j,i)
  • palm/trunk/SOURCE/radiation_model_mod.f90

    r1852 r1853  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Added routine for radiation_scheme = constant.
    2222
    2323! Former revisions:
     
    374374       MODULE PROCEDURE radiation_clearsky
    375375    END INTERFACE radiation_clearsky
    376  
     376 
     377    INTERFACE radiation_constant
     378       MODULE PROCEDURE radiation_constant
     379    END INTERFACE radiation_constant
     380 
    377381    INTERFACE radiation_header
    378382       MODULE PROCEDURE radiation_header
     
    403407!-- Public functions
    404408    PUBLIC radiation_check_data_output, radiation_check_data_output_pr,        &
    405            radiation_check_parameters, radiation_clearsky, radiation_header,   &
    406            radiation_init, radiation_parin, radiation_rrtmg, radiation_tendency
     409           radiation_check_parameters, radiation_clearsky, radiation_constant, &
     410           radiation_header, radiation_init, radiation_parin, radiation_rrtmg, &
     411           radiation_tendency
    407412   
    408413!
     
    757762       IF ( radiation_scheme == 'constant' )  THEN
    758763          rad_net = net_radiation
    759           radiation = .FALSE.
     764!          radiation = .FALSE.
    760765!
    761766!--    Calculate orbital constants
     
    769774
    770775
     776       IF ( radiation_scheme == 'constant' )  THEN
     777
     778          IF ( .NOT. ALLOCATED ( rad_lw_out ) )  THEN
     779             ALLOCATE ( rad_lw_out(0:0,nysg:nyng,nxlg:nxrg) )
     780          ENDIF
     781
     782       ENDIF
     783
    771784       IF ( radiation_scheme == 'clear-sky' )  THEN
    772785
     
    789802          IF ( .NOT. ALLOCATED ( rad_lw_in ) )  THEN
    790803             ALLOCATE ( rad_lw_in(0:0,nysg:nyng,nxlg:nxrg) )
    791           ENDIF
    792           IF ( .NOT. ALLOCATED ( rad_lw_out ) )  THEN
    793              ALLOCATE ( rad_lw_out(0:0,nysg:nyng,nxlg:nxrg) )
    794804          ENDIF
    795805
     
    989999!--    Calculate radiative fluxes at model start
    9901000       IF (  TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
    991           IF ( radiation_scheme == 'clear-sky' )  THEN
    992              CALL radiation_clearsky
    993           ELSEIF ( radiation_scheme == 'rrtmg' )  THEN
    994              CALL radiation_rrtmg
    995           ENDIF
     1001
     1002          SELECT CASE ( radiation_scheme )
     1003             CASE ( 'rrtmg' )
     1004                CALL radiation_rrtmg
     1005             CASE ( 'clear-sky' )
     1006                CALL radiation_clearsky
     1007             CASE ( 'constant' )
     1008                CALL radiation_constant
     1009             CASE DEFAULT
     1010          END SELECT
     1011
    9961012       ENDIF
    9971013
     
    10081024    SUBROUTINE radiation_clearsky
    10091025
    1010        USE indices,                                                            &
    1011            ONLY:  nbgp
    10121026
    10131027       IMPLICIT NONE
     
    10571071    END SUBROUTINE radiation_clearsky
    10581072
     1073
     1074!------------------------------------------------------------------------------!
     1075! Description:
     1076! ------------
     1077!> This scheme keeps the prescribed net radiation constant during the run
     1078!------------------------------------------------------------------------------!
     1079    SUBROUTINE radiation_constant
     1080
     1081
     1082       IMPLICIT NONE
     1083
     1084       INTEGER(iwp) :: i, j, k   !< loop indices
     1085       REAL(wp)     :: exn,   &  !< Exner functions at surface
     1086                       pt1       !< potential temperature at first grid level
     1087
     1088!
     1089!--    Calculate value of the Exner function
     1090       exn = (surface_pressure / 1000.0_wp )**0.286_wp
     1091!
     1092!--    Prescribe net radiation and estimate a longwave outgoing radiative
     1093!--    flux (needed in land surface model)
     1094       DO i = nxlg, nxrg
     1095          DO j = nysg, nyng
     1096             k = nzb_s_inner(j,i)
     1097
     1098             rad_net(j,i)      = net_radiation
     1099             rad_lw_out(0,j,i) = emissivity * sigma_sb * (pt(k,j,i) * exn)**4
     1100
     1101          ENDDO
     1102       ENDDO
     1103
     1104    END SUBROUTINE radiation_constant
    10591105
    10601106!------------------------------------------------------------------------------!
  • palm/trunk/SOURCE/time_integration.f90

    r1852 r1853  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! Adjusted for use with radiation_scheme = constant
    2222!
    2323! Former revisions:
     
    295295    USE radiation_model_mod,                                                   &
    296296        ONLY: dt_radiation, force_radiation_call, radiation,                   &
    297               radiation_clearsky, radiation_rrtmg, radiation_scheme,           &
    298               skip_time_do_radiation, time_radiation
     297              radiation_clearsky, radiation_constant, radiation_rrtmg,         &
     298              radiation_scheme, skip_time_do_radiation, time_radiation
    299299
    300300    USE spectra_mod,                                                           &
     
    863863                ELSEIF ( radiation_scheme == 'rrtmg' )  THEN
    864864                   CALL radiation_rrtmg
     865                ELSE
     866                   CALL radiation_constant
    865867                ENDIF
    866868
Note: See TracChangeset for help on using the changeset viewer.