[MITgcm-devel] changing exch-1

Jean-Michel Campin jmc at ocean.mit.edu
Tue May 4 17:07:38 EDT 2010


Hi,

I propose to split the basic exch1 subroutines (exch_rx.F,
generated from exch_rx.template) in 2 S/R, 1 forward and 
1 adjoint S/R, and then drop the "simulationMode" argument.

My impression is that this way we could leave TAF see all the
different exch_*_rx.f subroutines, just need to have the right
flow dir for this basic exch1 S/R.

This would also be much closer to what is done in pkg/exch2
(no true "simulationMode" arg., TAF see almost all the exch2_*_rx.f 
 files, with flow dir and hand written AD S/R for the 2 basic 
 exch2 S/R: exch2_rx1_cube & exch2_rx2_cube)

This way, we could avoid to have this mixed (and confusing) situation 
where:
- without EXCH2, for each of exch_*_rx.f subroutine we need
  an hand-written AD version (generally just a call to basic exch1 S/R 
  with arg. simulationMode = Reverse).
- with EXCH2, those exch1 S/R need to be (and are already) listed 
  in pkg/exch2/exch2_ad_diff.list
  and the flow dir from pkg/autodiff/exch*ad*.flow needs to 
  be hidden (as well as the hand-written AD S/R version).

We will need also a quick solution for the 4 exch_*_rx_cube
(exch_rx_cube, exch_uv_rx_cube, exch_z_rx_cube, exch_bg_rx_cube)
but presently the code corresponding to simulationMode=Reverse is 
missing; so not a big deal to leave just a stop in an empty
hand-written AD S/R.

And finally, the recent problems I found in AD-exch (one did not
show up in my tests, but the other with exch2 & exf is likely
to affect the CS-510 AD runs: Dimitris, can you check ?)
tend to indicate that a more transparent coding could help;
And since there are still few specific exch (B-grid, D-grid,
SM ) which need an AD version, it could be a good time to 
clean-up the AD-exch1 stuff (before adding the missing ones).

Suggestions ? Comments ?

Cheers,
Jean-Michel



More information about the MITgcm-devel mailing list