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

Nidia Martinez nidiamartinez at ucsd.edu
Mon Jul 11 15:36:09 EDT 2011


Hi Chris,

I am using the bottom drag as a control and it works just fine.
I can't help with the netcdf part because I don't use that. But I do get 
binaries with non-zero sensitivities to bottomdrag.

I switched it on in ECCO_CPPOPTIONS.h and I added the file in data.ctrl 
to be written.

#define ALLOW_BOTTOMDRAG_COST
#define ALLOW_BOTTOMDRAG_CONTROL

then in data.ctrl add:
xx_bottomdrag_file = 'xx_bottomdrag',

I get non-zero sensitivities:
bottomdrag = rdmds([dpath 'adxx_bottomdrag.0000000000.001.001']);


The only thing is that I get recomputation:
TAF RECOMPUTATION WARNING CALL_STMT ad_input_code.f:402426 in the_main_loop
TAF RECOMPUTATION WARNING CALL_STMT ad_input_code.f:402426 in the_main_loop

But since the running time with or without the bottom drag on takes the 
same time, I guess that recomputation is harmless and I didn't really 
bother to solve it.

I hope this helps,
Nidia

>
> 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
>>      
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>    

-- 
------------------------------------------------------------------------------
Nidia Martinez Avellaneda, Ph.D.
Scripps Institution of Oceanography
University California San Diego
9500 Gilman Drive, La Jolla, CA 92093-0230

Phone:   +1 858-822-7692
E-mail:  nidiamartinez at ucsd.edu
------------------------------------------------------------------------------




More information about the MITgcm-support mailing list