[Mitgcm-support] Re: bug for DIVA with -mpi
mitgcm-support at dev.mitgcm.org
mitgcm-support at dev.mitgcm.org
Wed Jul 9 15:50:18 EDT 2003
Hi Patrick,
I have fixed all the bugs you reported:
- the wrong error message using option -pure has been removed
- mythid is now argument of adthe_main_loop
- divided adjoint with -mpi: calls of MPI_Bcast are outside the if construct
For the remaining issues:
(2):
The -pure options is used to generate adjoint code which does NOT compute the
function value. In case of taping, the modified toplevel routine writes the
tape and computes the function value.
So one solution is to write the function value to a file after calling the
modified toplevel routine (mdthe_main_loop) and to read the file whenever the
value is needed.
(3):
The trajectory recomputation is indeed triggered by psbar, sbar, and tbar, more precisely by:
xx_psbar_mean_dummy,xx_sbar_mean_dummy,xx_tbar_mean_dummy
The variables are required by adcost_ssh since it reads the related files.
TAF cannot know that these are dummy variables only used to simulate the dependence on files.
The solution is to store these variables on tape.
In addition mytime and myiter need to be stored.
I have installed the new TAF version only on sea.
I will update the other installations after some more intensive testing.
Ralf
Modifications in the_main_loop:
c-- Initialize storage for the outermost loop.
CADJ INIT tapelev3 = USER
c-- Some more initialisations to please TAMC
CADJ INIT tapelev_ini_bibj_k = USER
cadj init onetape = common, 1
.......
CALL BARRIER(myThid)
call timer_stop ('ECCO MAIN LOOP', mythid)
call timer_start('ECCO SPIN-DOWN', mythid)
cadj store mytime, myiter = onetape
c-- Accumulate time averages of temperature, salinity, and SSH.
call timer_start('cost_AveragesFields [ECCO SPIN-DOWN]', mythid)
call cost_AveragesFields( mytime, myiter, mythid )
call timer_stop ('cost_AveragesFields [ECCO SPIN-DOWN]', mythid)
cadj store xx_psbar_mean_dummy = onetape
cadj store xx_sbar_mean_dummy = onetape
cadj store xx_tbar_mean_dummy = onetape
c-- Compute cost function contribution of Temperature and Salinity.
call timer_start('COST_HYD [ECCO SPIN-DOWN]', mythid)
call cost_Hyd( myiter, mytime, mythid )
call timer_stop ('COST_HYD [ECCO SPIN-DOWN]', mythid)
--
###################################################
Dr. Ralf Giering
FastOpt
Martinistr. 21
20251, Hamburg, Germany
Tel. : +49 40 48096347
Fax : +49 40 48096357
Email: Ralf.Giering at FastOpt.de
URL : http://www.FastOpt.de
###################################################
More information about the MITgcm-support
mailing list