Skip to content

Commit

Permalink
Update master with change to develop (#30)
Browse files Browse the repository at this point in the history
* Remove nullify on declaration for thread safety (#29)

Remove nullify statements on declaration of pointers in subroutines to ensure
thread safety for mo_gas_optics_rrtmgp. When pointers get assigned in
declarations, they implicitly get a save attribute and are assumed static. This
is a problem when then occurs in a threaded region, so this code was NOT
thread-safe before. Removing the `=> NULL()` does not change the behavior of the
code for non-threaded applications, but does ensure thread-safety.

* Array size bug fix in compute_bc()
  • Loading branch information
RobertPincus authored Jun 14, 2019
1 parent 53059e7 commit d7f19ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extensions/mo_compute_bc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function compute_bc(k_dist, &
allocatable :: optical_props_1lay
type(ty_fluxes_1lev) :: fluxes_1lev
type(ty_source_func_lw) :: lw_sources_1lay
real(wp), dimension(size(play,1),k_dist%get_nband()) :: solar_src
real(wp), dimension(size(play,1),k_dist%get_ngpt()) :: solar_src
! ----------------------------------------------------------
!
! Problem extent
Expand Down
1 change: 0 additions & 1 deletion rrtmgp/kernels/mo_gas_optics_kernels.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

module mo_gas_optics_kernels
use mo_rte_kind, only : wp, wl
use mo_util_string, only : string_loc_in_array
implicit none

interface zero_array
Expand Down
4 changes: 2 additions & 2 deletions rrtmgp/mo_gas_optics_rrtmgp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ function compute_gas_taus(this, &
integer :: igas, idx_h2o ! index of some gases
! Number of molecules per cm^2
real(wp), dimension(ncol,nlay), target :: col_dry_arr
real(wp), dimension(:,:), pointer :: col_dry_wk => NULL()
real(wp), dimension(:,:), pointer :: col_dry_wk
!
! Interpolation variables used in major gas but not elsewhere, so don't need exporting
!
Expand Down Expand Up @@ -607,7 +607,7 @@ function source(this, &
real(wp), dimension(ngpt, ncol) :: sfc_source_t
! Variables for temperature at layer edges [K] (ncol, nlay+1)
real(wp), dimension( ncol,nlay+1), target :: tlev_arr
real(wp), dimension(:,:), pointer :: tlev_wk => NULL()
real(wp), dimension(:,:), pointer :: tlev_wk
! ----------------------------------------------------------
error_msg = ""
!
Expand Down

0 comments on commit d7f19ed

Please sign in to comment.