// File: JRLamontagne[P]cdice_sa/CDICEInit.cpp
// Function: allocateClim(DICE*)
void allocateClim(DICE *dice)
{
  
  if(dice->ctrl.use_doeclim==1) {
    // DOEclim model variables
    dice->clim.forc = new double[dice->config.ns];
    dice->clim.IB = new double[4];
    dice->clim.A = new double[4];
    dice->clim.Ker = new double[dice->config.ns];
    
    dice->clim.temp = new double[dice->config.ns];
    dice->clim.temp_landair = new double[dice->config.ns];
    dice->clim.temp_sst = new double[dice->config.ns];
    dice->clim.heat_mixed = new double[dice->config.ns];
    dice->clim.heat_interior = new double[dice->config.ns];
    dice->clim.heatflux_mixed = new double[dice->config.ns];
    dice->clim.heatflux_interior = new double[dice->config.ns];
    
    dice->clim.cs_cal = new double [dice->config.n_calpoints];
    dice->clim.kv_cal = new double [dice->config.n_calpoints];
    dice->clim.alpha_cal = new double [dice->config.n_calpoints];
    
		//doeclim_DICE_init(dice);

  }

  else {
    // DICE Climate model variables
    dice->clim.tatm = new double[dice->config.nPeriods];		// Increase temperature of atmosphere [dC from 1900]
    dice->clim.tocean = new double[dice->config.nPeriods];	// Increase temperature of lower oceans [dC from 1900]
    
  }

  return;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
cmpl $0x1, 0x58(%rax)
jne 0x12e59
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0xb0(%rax)
movl $0x20, %edi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x100(%rax)
movl $0x20, %edi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x108(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x120(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x140(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x148(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x150(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x158(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x160(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x168(%rax)
movq (%rsp), %rax
movslq 0x28(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x170(%rax)
movq (%rsp), %rax
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x178(%rax)
movq (%rsp), %rax
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x180(%rax)
movq (%rsp), %rax
movslq 0x30(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x188(%rax)
jmp 0x12ec5
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x128(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x130(%rax)
popq %rax
retq
nopw (%rax,%rax)