Skip to content

Commit

Permalink
BLING "spring cleaning" (MITgcm#778)
Browse files Browse the repository at this point in the history
* BLING "spring cleaning"

* clean up store directives and restructure a little for easier AD

This change speeds up ADTHE_MAIN_LOOP in
verification/global_oce_bio_bling by a factor of 7 (!), mainly because
it fixes the extensive recomputations. Relative to the version prior
to this PR the speed up is small.

With this commit (on my laptop):
User/System/Wall clock time:   51.93 sec / 0.30 sec /  52.59 sec
Before:
User/System/Wall clock time:  358.49 sec / 0.35 sec / 360.67 sec

* clean up diagnostics, chl_sat

* clean up diagnostics, chl_sat

* adjust cpp-flags to reduce number of taf-not-necessary-warnings

* make s/r bling_min_val visible to taf, adjust store directives

- remove bling_write_pickup.f from bling_ad_diff.list because the call
is not visible to taf anyway
- remove bling_read_pickup.f from bling_ad_diff.list because there are
flow directives (avoid another warning)

* add chlsat_t parameters to namelist and set default values

* remove double blank line

* improve new chl_sat time-window

- rename the 2 new params to "chlsat_locTimWindow(2)" (in decimal hour)
- use "decimal hour" consistently (this fix inaccurate time-window criteria).
- allow to be used without pkg/cal

* bring back PR MITgcm#579 changes

just to avoid un-used variables

* minor adjustment

* document improvements in pkg/bling

---------

Co-authored-by: averdy <[email protected]>
Co-authored-by: Jean-Michel Campin <[email protected]>
Co-authored-by: mjlosch <[email protected]>
Co-authored-by: Jean-Michel Campin <[email protected]>
  • Loading branch information
5 people authored May 22, 2024
1 parent 672b822 commit 82e538d
Show file tree
Hide file tree
Showing 10 changed files with 255 additions and 80 deletions.
5 changes: 5 additions & 0 deletions doc/tag-index
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Notes on tags used in MITgcmUV
==============================

o pkg/bling:
- fix/improve initialization of biomass for the 3 phytoplankton groups ;
- add 2D diagnostics of optically integrated chlorophyll concentration
within local-time window to be compared with satellite observation ;
- improve TAF store directives (reduce recomputations).
o pkg/obcs (tides):
- more efficient implementation of OB barotropic tidal velocity components,
with both Cos & Sin of phase times Amplitude stored in common block ;
Expand Down
8 changes: 7 additions & 1 deletion pkg/bling/BLING_VARS.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ C ==========================================================
C ==========================================================
C Ecosystem variables and parameters
C ==========================================================
C chlsat_locTimWindow(1:2) :: local-time window (in h) for
C satellite-equivalent chlorophyll diagnostic (and cost)

COMMON /BIOTIC_NEEDS/
& InputFe,
Expand All @@ -253,6 +255,7 @@ C ==========================================================
& phyto_lg,
& phyto_sm,
& chl,
& chl_sat,
& poc,
& Pc_0_2d,
& k_Fe_2d,
Expand Down Expand Up @@ -344,7 +347,8 @@ C ==========================================================
& parfrac,
& alpfe,
& k0,
& MLmix_max
& MLmix_max,
& chlsat_locTimWindow

_RL InputFe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
_RL omegaC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
Expand All @@ -353,6 +357,7 @@ C ==========================================================
_RL phyto_lg(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL phyto_sm(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL chl(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL chl_sat(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
_RL poc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
_RL Pc_0_2d(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
_RL k_Fe_2d(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
Expand Down Expand Up @@ -445,6 +450,7 @@ C ==========================================================
_RL alpfe
_RL k0
_RL MLmix_max
_RL chlsat_locTimWindow(2)

CEH3 ;;; Local Variables: ***
CEH3 ;;; mode:fortran ***
Expand Down
7 changes: 0 additions & 7 deletions pkg/bling/bling_ad.flow
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@ C subroutine BLING_READ_PICKUP
C----------------------------------------
CADJ SUBROUTINE BLING_READ_PICKUP INPUT = 1,2,3
CADJ SUBROUTINE BLING_READ_PICKUP OUTPUT = 1

C----------------------------------------
C subroutine BLING_MIN_VAL
C----------------------------------------
CADJ SUBROUTINE BLING_MIN_VAL INPUT = 1,2,3,4,5
CADJ SUBROUTINE BLING_MIN_VAL OUTPUT =

3 changes: 1 addition & 2 deletions pkg/bling/bling_ad_diff.list
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ bling_mixedlayer.f
bling_bio.f
bling_bio_nitrogen.f
bling_readparms.f
bling_read_pickup.f
bling_solvesaphe.f
bling_write_pickup.f
bling_min_val.f
Loading

0 comments on commit 82e538d

Please sign in to comment.