[MITgcm-support] Adjoint BOTTOMDRAG_CONTROL, adbottomdragfld : can't get non-zero sensitivity

Martin Losch Martin.Losch at awi.de
Mon Jul 11 04:42:01 EDT 2011


Hi Chris,

since bottomdrag is a control variable, there should also be a adxx_bottomdrag.*.data/meta pair at the end of the intergratioin (completely independent of adjdumpFreq). Does that have non-zero values?

The output of taf (taf_ad.log) is also a source of information, you might find that the solution does not depend on xx_bottomdrag_dummy or something like that, which would point to problems in the forward code.

I never used bottom drag as a control variable, and there do not seem to be any verification experiments for this either. But this is what I would do for debugging:
1. do not use MNC for debugging, it just introduces another source of error (although your addtions look good and we should added them to the repository, once you solved your problem).
2. make sure that in ad_taf_output.f there are common blocks with adbottomfld, and that they have have the same name as the one in adcommon.h. These might have changed with new version of TAF or TAMC (there are no new versions of TAMC, of course). If all of that is consistent, I'd
3. do some ugly "hallo debugging" in ad_taf_output.f: print the values of adbottomfld where it is modified: adctrl_map_ini or adctrl_map_ini_ecco and, more likely admom_u_bottomdrag and admom_v_bottomdrag.

Martin


On Jul 7, 2011, at 6:13 PM, Chris Wilson wrote:

> Hi,
> 
> I'm trying to find the sensitivity of free-surface height at a point to particular control variables.  
> For many control variables, e.g. velocity, wind stress, eta, this works fine and plausible non-zero sensitivities are found in both the binary and netCDF output (adstate*.nc).
> 
> However, when I try to switch on bottom drag as a control variable (ALLOW_BOTTOMDRAG_CONTROL), it seems that I need to add some extra code to get the model to write the that sensitivity to the netCDF file:
> 
> i.e. in pkg/autodiff/autodiff_ini_model_io.F, I need to add something like
> 
> #ifdef ALLOW_BOTTOMDRAG_CONTROL
>      CALL MNC_CW_ADD_VNAME('adbottomdragfld', 'Cen_xy_Hn__-__t',
>     .3,4, myThid)
>      CALL MNC_CW_ADD_VATTR_TEXT('adbottomdragfld',
>     &     'units','[cost]/[N/m^2]', myThid)
>      CALL MNC_CW_ADD_VATTR_TEXT('adbottomdragfld','long_name',
>     &     'adjoint bottom_drag', myThid)
>      CALL MNC_CW_ADD_VATTR_TEXT('adbottomdragfld',
>     &     'coordinates','XC YC RC iter', myThid)
> #endif
> 
> 
> and in pkg/autodiff/addummy_in_stepping.F, I need to add something like
> 
> #ifdef ALLOW_BOTTOMDRAG_CONTROL
>          CALL MNC_CW_RL_W('D','adstate',0,0,'adbottomdragfld',
>     .adbottomdragfld, myThid)      
> #endif
> 
> -----
> This is perhaps an aside from the real issue, that whatever I try I cannot get a non-zero adjoint sensitivity w.r.t. bottom drag, in either the netCDF or binary output.  I include the netCDF aside because I'm reluctant to remove the changes and, if I'm not wrong, they make me question whether other code tweaks might be needed for bottom drag sensitivity to work correctly.
> 
> ->> Could anyone please recommend a recipe for 
> 
> a) switching on this adjoint sensitivity successfully
> 
> or 
> 
> b) choosing the correct runtime/buildtime flags to make sure the sensitivity is non-zero?
> 
> 
> Thanks,
> 
> Chris W
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list