small bug in ad_npzd_iron.h

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
jpm
Posts: 21
Joined: Thu Aug 27, 2009 4:37 pm
Location: UCSC

small bug in ad_npzd_iron.h

#1 Unread post by jpm »

The adjoint variables ad_ExpAtt and ad_Itop in the NPZD iron model are not initialized properly:

For ad_ExpAtt, the debugger message is:
The variable 'ad_biology_mod_mp_ad_biology_tile_$AD_EXPATT' is being used without being defined
A "ad_ExpAtt=0.0_r8" and "ad_Itop=0.0_r8" are missing in ad_npzd_iron.h:

Code: Select all

      real(r8) :: ad_Att, ad_ExpAtt, ad_Itop, ad_PAR

!  [...] (ad_ExpAtt and ad_Itop are not being defined or used)

!
!  Adjoint of light attenuation at the bottom of the grid cell. It is
!  the starting PAR value for the next (deeper) vertical grid cell.
!
!>              tl_PAR=tl_Itop*ExpAtt+Itop*tl_ExpAtt
!>
                ad_ExpAtt=ad_ExpAtt+Itop*ad_PAR
                ad_Itop=ad_Itop+ExpAtt*ad_PAR
Jann Paul Mattern, Ocean Sciences Department, UCSC

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: small bug in ad_npzd_iron.h

#2 Unread post by arango »

Good catch :!: Indeed, we need to initializing both to zero in the adjoint code. Thank you for reporting this bug.

Post Reply