Skip to content

Commit

Permalink
Only allocate KPP_CS if requested
Browse files Browse the repository at this point in the history
The CVMix KPP module would allocate it's control structure regardless
of wthether KPP was used or not. The allocate statement has been moved
down after USE_KPP has been parsed.
  • Loading branch information
ashao committed Sep 14, 2019
1 parent 8ab7aa8 commit 9b4d2c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ logical function KPP_init(paramFile, G, GV, US, diag, Time, CS, passive, Waves)
!! False => compute G'(1) as in LMD94
if (associated(CS)) call MOM_error(FATAL, 'MOM_CVMix_KPP, KPP_init: '// &
'Control structure has already been initialized')
allocate(CS)

! Read parameters
call log_version(paramFile, mdl, version, 'This is the MOM wrapper to CVMix:KPP\n' // &
Expand All @@ -207,6 +206,7 @@ logical function KPP_init(paramFile, G, GV, US, diag, Time, CS, passive, Waves)
default=.false.)
! Forego remainder of initialization if not using this scheme
if (.not. KPP_init) return
allocate(CS)

call openParameterBlock(paramFile,'KPP')
call get_param(paramFile, mdl, 'PASSIVE', CS%passiveMode, &
Expand Down

0 comments on commit 9b4d2c2

Please sign in to comment.