Skip to content

Commit

Permalink
Bugfix: uninitialized variable debug_ in midas_vertmap
Browse files Browse the repository at this point in the history
- Reported by @nicjhan in issue #149.
- debug_ was meant to be set to the state of an optional argument
  but if the optional argument was not present debug_ was never set.
  - i_debug and j_debug were also reported as uninitialized but I
    think initializating debug_ will avoid those references.
- No answer changes.
  • Loading branch information
adcroft committed Apr 28, 2015
1 parent 719c885 commit b7ffdc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/initialization/midas_vertmap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,21 @@ function tracer_z_init(tr_in,z_edges,e,nkml,nkbl,land_fill,wet,nlay,nlevs,debug,
integer :: k_top,k_bot,k_bot_prev,kk,kstart
real :: sl_tr
real, dimension(size(tr_in,3)) :: wt,z1,z2
logical :: debug_msg = .false.,debug_=.false.
logical :: debug_msg, debug_

nx = size(tr_in,1); ny=size(tr_in,2); nz = size(tr_in,3)

nlevs_data = size(tr_in,3)

if (PRESENT(nlevs)) then
nlevs_data = anint(nlevs)
endif

debug_=.false.
if (PRESENT(debug)) then
debug_=debug
endif

debug_msg = .false.
if (debug_) then
debug_msg=.true.
endif
Expand Down

0 comments on commit b7ffdc9

Please sign in to comment.