Skip to content

Commit 50f1a1d

Browse files
CHG: estetics
1 parent df69a40 commit 50f1a1d

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

src/c/cores/controladm1qn3_core.cpp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -202,29 +202,24 @@ void simul_ad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],flo
202202
/*Start Tracing*/
203203
simul_starttrace(femmodel);
204204
/*Set X as our new control input and as INDEPENDENT*/
205-
#ifdef _HAVE_AD_
205+
#ifdef _HAVE_AD_
206206
IssmDouble* aX=xNew<IssmDouble>(intn,"t");
207-
#else
207+
#else
208208
IssmDouble* aX=xNew<IssmDouble>(intn);
209-
#endif
209+
#endif
210210

211-
#if defined(_HAVE_ADOLC_)
212211
if(my_rank==0){
213212
for(int i=0;i<intn;i++){
214-
aX[i]<<=X[i];
213+
#if defined(_HAVE_ADOLC_)
214+
aX[i]<<=X[i];
215+
#elif defined(_HAVE_CODIPACK_)
216+
aX[i]=X[i];
217+
codi_global.registerInput(aX[i]);
218+
#else
219+
_error_("not suppoted");
220+
#endif
215221
}
216222
}
217-
#elif defined(_HAVE_CODIPACK_)
218-
219-
if(my_rank==0){
220-
for (int i=0;i<intn;i++) {
221-
aX[i]=X[i];
222-
codi_global.registerInput(aX[i]);
223-
}
224-
}
225-
#else
226-
_error_("not suppoted");
227-
#endif
228223

229224
ISSM_MPI_Bcast(aX,intn,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
230225
SetControlInputsFromVectorx(femmodel,aX);
@@ -374,7 +369,7 @@ void simul_ad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],flo
374369

375370
xDelete<IssmPDouble>(dependents);
376371
xDelete<IssmPDouble>(totalgradient);
377-
} /*====????*/
372+
}
378373

379374
/*Constrain Gradient*/
380375
IssmDouble Gnorm = 0.;

0 commit comments

Comments
 (0)