Skip to content

Commit

Permalink
Merge branch 'master' into darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
jahn committed Nov 7, 2023
2 parents 459d5a8 + ec9548c commit 83d6e05
Show file tree
Hide file tree
Showing 281 changed files with 6,634 additions and 6,220 deletions.
3 changes: 0 additions & 3 deletions doc/examples/global_oce_optim/global_oce_optim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ variable in :filelink:`pkg/ctrl` by modifying the following subroutines:
- :filelink:`pkg/ctrl/ctrl_map_forcing.F` in which the updated adjustment is added to the
first guess :math:`Q_\mathrm{netm}`.

Note also some minor changes in :filelink:`pkg/ctrl/ctrl.h`, :filelink:`pkg/ctrl/ctrl_readparms.F`, and
:filelink:`pkg/ctrl/ctrl_dummy.h` (:varlink:`xx_hfluxm_file`, :varlink:`fname_hfluxm`, :varlink:`xx_hfluxm_dummy`).

Cost functions
~~~~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions doc/outp_pkgs/outp_pkgs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ Currently, the available adjoint state variables are:
114 |ADJsalt | 15 | |SMRA MR|dJ/(g/kg) |dJ/dSalt: Sensitivity to salinity
115 |ADJtaux | 1 | 116 |UU A U1|dJ/(N/m^2) |dJ/dTaux: Senstivity to zonal surface wind stress
116 |ADJtauy | 1 | 115 |VV A U1|dJ/(N/m^2) |dJ/dTauy: Sensitivity to merid. surface wind stress
117 |ADJempmr| 1 | |SM A U1|dJ/(kg/m^2/s) |dJ/dEmPmR: Sensitivity to net surface Fresh-Water flux into the ocean
118 |ADJqnet | 1 | |SM A U1|dJ/(W/m^2) |dJ/dQnet: Sensitivity to net surface heat fluxinto the ocean
117 |ADJempmr| 1 | |SM A U1|dJ/(kg/m^2/s) |dJ/dEmPmR: Sensitivity to net surface freshwater flux
118 |ADJqnet | 1 | |SM A U1|dJ/(W/m^2) |dJ/dQnet: Sensitivity to net surface heat flux
119 |ADJqsw | 1 | |SM A U1|dJ/(W/m^2) |dJ/dQsw: Sensitivitiy to net Short-Wave radiation
120 |ADJsst | 1 | |SM A M1|dJ/K |dJ/dSST: Sensitivity to Sea Surface Temperature
121 |ADJsss | 1 | |SM A M1|dJ/(g/kg) |dJ/dSSS: Sensitivity to Sea Surface Salinity
Expand Down
47 changes: 47 additions & 0 deletions doc/tag-index
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
Notes on tags used in MITgcmUV
==============================

checkpoint68t (2023/10/28)
o pkg/dic:
- improve carbonate dissolution options (new params: selectCalciteDissolution)
and fix a minor bug in dissolution rates according to Keir et al (1980);
- change exp. so_box_biogeo secondary tests caSat0/3 to test option 2 & 3.
o pkg/gmredi:
- fix setting of GM_ExtraDiag that was not (always) turned on with 3D Kappa
read from file, with Bates-K3d or QG-Leith, therefore missing 2 terms in
isopycnal diffusion tensor; update ref. output of MLAdjust.QGLthGM test ;
- add more check and stop for the case #undef GM_NON_UNITY_DIAGONAL ;
- add runtime parameter GM_isoFac_calcK to allow to scale dynamically computed
Kappa contribution in the Redi-tensor (default = 1.).
o pkg/autodiff:
- adjust call to S/R DIAGNOSTICS_SWITCH_ONOFF in autodiff_inadmode_set_ad.F
so that snap-shot Adjoint diagnostics are filled within the same time-step
as they are written to output file.
o pkg/ctrl:
- rename ctrl_dummy.h to CTRL_DUMMY.h, remove unused variables & common blocks
- retire CPP-flag ALLOW_HFACC/HFACC3D_CONTROL and remove related code.
o pkg/ctrl:
- rename header file "ctrl.h" to "CTRL.h".
o utils/matlab/cs_grid:
- update some basic matlab-scripts for CS-grid (split_*_cub.m,
rotate_uv2uvEN.m, mk_psiLine_CS.m & use_psiLine.m) to a) also work with
compact-format input; and (b) always assume "long-vector" are stored one
face after the other (compact-format compatible);
- new script to generate broken-lines (for computing meridional transport
stream-function), simpler than the previous version in cs_grid/bk_line/;
- update RGB-dims in 2 latloncap/ scripts to match pkg/exch2 convention.
o pkg/ctrl:
- simplify file name handling in ctrl_map_ini_gentim2d.F to please TAF (fixes
hs94.1x64x5 TL test) without upsetting Tapenade & OpenAD.
o pkg/autodiff + ecco:
- fix a typo in AD-var output file name (addummy_in_stepping.F);
- fix and improve weight output in pkg/ecco/cost_generic.F
o pkg/streamice:
- implementation of parameterized depth-dependent ice-shelf melt rate ;
- new subroutines added to accumulate misfit cost based on time-dependent
surface elevation and velocity observations (+ calls in pkg/cost) ;
- fix generic ctrl (ctrl_map_ini_{genarr,gentim2d}.F) for OpenAD and
add mapping of STREAMICE arrays to generic controls ;
- update exp. halfpipe_streamice OAD & Tap setup (remove customized *.F)
and switch on new CPP option ALLOW_COST_STREAMICE (+adjust params files).
o pkg/autodiff:
- fix a bug in ALLOW_AUTODIFF_WHTAPEIO code with ALLOW_DIVIDED_ADJOINT ;
- refine grad-check + update output for AD test "lab_sea.noseaicedyn".

checkpoint68s (2023/09/11)
o verification:
- change default ALLOW_IB_CORR (in pkg/ecco/ECCO_OPTIONS.h) to "#undef" and
Expand Down
4 changes: 2 additions & 2 deletions model/src/diags_sound_speed.F
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SUBROUTINE DIAGS_SOUND_SPEED(
C *==========================================================*
C | S/R DIAGS_SOUND_SPEED
C | o Diagnose speed of sound in seawater
C | from the algorithm by Del Grasso (1974).
C | from the algorithm by Del Grosso (1974).
C | This is NOT the sound-speed that can be derived from
C | the equation of state (EOS). It is independent of
C | the model setup specific EOS.
Expand Down Expand Up @@ -97,7 +97,7 @@ SUBROUTINE DIAGS_SOUND_SPEED(
temp = SW_TEMP( SALT(i,j,k,bi,bj),
& THETA(i,j,k,bi,bj), pres, zeroRL )
sal = SALT(i,j,k,bi,bj)
C convert pressure to kg/cm^2 for Del Grasso algorithm
C convert pressure to kg/cm^2 for Del Grosso algorithm
pres = pres/gravity
ct = ( 5.01109398873 _d 0 - ( 0.550946843172 _d -1
& - 0.221535969240 _d -3 * temp ) * temp ) * temp
Expand Down
2 changes: 1 addition & 1 deletion model/src/do_oceanic_phys.F
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ SUBROUTINE DO_OCEANIC_PHYS(myTime, myIter, myThid)
# endif
# ifdef ALLOW_EXF
# ifdef ALLOW_CTRL
# include "ctrl.h"
# include "CTRL.h"
# endif
# include "EXF_FIELDS.h"
# ifdef ALLOW_BULKFORMULAE
Expand Down
4 changes: 2 additions & 2 deletions model/src/forward_step.F
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ SUBROUTINE FORWARD_STEP( iloop, myTime, myIter, myThid )
# endif
# ifdef ALLOW_CTRL
# include "CTRL_SIZE.h"
# include "ctrl.h"
# include "ctrl_dummy.h"
# include "CTRL.h"
# include "CTRL_DUMMY.h"
# include "CTRL_GENARR.h"
# include "CTRL_OBCS.h"
# endif
Expand Down
4 changes: 2 additions & 2 deletions model/src/initialise_varia.F
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ SUBROUTINE INITIALISE_VARIA( myThid )
# ifdef ALLOW_CTRL
# include "CTRL_SIZE.h"
# include "optim.h"
# include "ctrl.h"
# include "CTRL.h"
# include "CTRL_GENARR.h"
# include "ctrl_dummy.h"
# include "CTRL_DUMMY.h"
# endif
# ifdef ALLOW_CD_CODE
# include "CD_CODE_VARS.h"
Expand Down
4 changes: 2 additions & 2 deletions model/src/load_fields_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ SUBROUTINE LOAD_FIELDS_DRIVER( myTime, myIter, myThid )
# endif
# ifdef ALLOW_CTRL
# include "CTRL_SIZE.h"
# include "ctrl.h"
# include "CTRL.h"
# include "CTRL_GENARR.h"
# include "ctrl_dummy.h"
# include "CTRL_DUMMY.h"
# endif
# ifdef ALLOW_COST
# include "cost.h"
Expand Down
4 changes: 2 additions & 2 deletions model/src/main_do_loop.F
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ SUBROUTINE MAIN_DO_LOOP( iloop, myTime, myIter, myThid )

# ifdef ALLOW_CTRL
# include "CTRL_SIZE.h"
# include "ctrl.h"
# include "ctrl_dummy.h"
# include "CTRL.h"
# include "CTRL_DUMMY.h"
# include "CTRL_GENARR.h"
# include "CTRL_OBCS.h"
# endif
Expand Down
4 changes: 2 additions & 2 deletions model/src/packages_init_variables.F
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ SUBROUTINE PACKAGES_INIT_VARIABLES( myThid )
# ifdef ALLOW_CTRL
# include "CTRL_SIZE.h"
# include "optim.h"
# include "ctrl.h"
# include "CTRL.h"
# include "CTRL_GENARR.h"
# include "ctrl_dummy.h"
# include "CTRL_DUMMY.h"
# endif
# ifdef ALLOW_PTRACERS
# include "PTRACERS_SIZE.h"
Expand Down
35 changes: 24 additions & 11 deletions model/src/the_main_loop.F
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid )

# ifdef ALLOW_CTRL
# include "CTRL_SIZE.h"
# include "ctrl.h"
# include "ctrl_dummy.h"
# include "CTRL.h"
# include "CTRL_DUMMY.h"
# include "CTRL_GENARR.h"
# include "CTRL_OBCS.h"
# endif
Expand Down Expand Up @@ -290,7 +290,7 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid )
c-- Initialize storage for the cost function evaluation.
c---------------------------------------------------------
c-- Initialize storage for the initialisation phase.
# ifdef ALLOW_AUTODIFF_WHTAPEIO
# if ( defined ALLOW_AUTODIFF_WHTAPEIO && !defined ALLOW_DIVIDED_ADJOINT )
CADJ INIT tapelev_init = COMMON, 1
# else
CADJ INIT tapelev_init = USER
Expand All @@ -299,7 +299,11 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid )
cCADJ INIT tapelev_ini_bibj = USER
# ifdef INCLUDE_CONVECT_INI_CALL
c-- currently only used in convective_adjustement_ini.F
# if ( defined ALLOW_AUTODIFF_WHTAPEIO && !defined ALLOW_DIVIDED_ADJOINT )
CADJ INIT tapelev_ini_bibj_k = COMMON, nSx*nSy*Nr
# else
CADJ INIT tapelev_ini_bibj_k = USER
# endif
# endif
# ifdef ALLOW_GENTIM2D_CONTROL
c-- exclusive tape for variables with suffix "_dummy"
Expand Down Expand Up @@ -327,15 +331,25 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid )

#ifdef ALLOW_AUTODIFF_TAMC
ikey_dynamics = 1
# if ( defined ALLOW_AUTODIFF_WHTAPEIO && defined ALLOW_DIVIDED_ADJOINT )
C this needs to happen before any store directive to taplev_init
CALL AUTODIFF_WHTAPEIO_SYNC( 1 , 0, myThid )
# endif
# ifdef ALLOW_GENTIM2D_CONTROL
CADJ STORE xx_gentim2d_dummy = dummytape, key = 1 , kind = isbyte
# endif
# ifdef ALLOW_SHELFICE
CADJ STORE shelficeLoadAnomaly = tapelev_init, key=1, kind=isbyte
# endif
# ifdef ALLOW_STREAMICE
CADJ STORE H_streamice = tapelev_init, key=1
CADJ STORE B_glen = tapelev_init, key=1
CADJ STORE H_streamice = tapelev_init, key=1
CADJ STORE B_glen = tapelev_init, key=1
CADJ STORE bdot_streamice = tapelev_init, key=1
CADJ STORE c_basal_friction = tapelev_init, key=1
CADJ STORE streamice_bdot_maxmelt_v = tapelev_init, key=1
# ifdef USE_ALT_RLOW
CADJ STORE r_low_si = tapelev_init, key=1
# endif
# endif
# ifdef ALLOW_DIC
CADJ STORE co2atmos = tapelev_init, key = 1
Expand All @@ -344,12 +358,6 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid )
#endif

#ifdef ALLOW_OPENAD
# ifdef ALLOW_DIFFKR_CONTROL
c$openad INDEPENDENT(xx_diffkr_dummy)
# endif
# ifdef ALLOW_KAPGM_CONTROL
c$openad INDEPENDENT(xx_kapgm)
# endif
# ifdef ALLOW_GENARR2D_CONTROL
cphc$openad INDEPENDENT(xx_genarr2d)
c$openad INDEPENDENT(xx_genarr2d_dummy)
Expand Down Expand Up @@ -391,6 +399,11 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid )
CALL TIMER_STOP ('INIT_PDAF [THE_MAIN_LOOP]', myThid)
#endif

#if ( defined ALLOW_AUTODIFF_WHTAPEIO && defined ALLOW_DIVIDED_ADJOINT )
C end of initialisation and use of tapelev_init: write buffer to disk
CALL AUTODIFF_WHTAPEIO_SYNC( 1 , 1, myThid )
#endif

c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef ALLOW_OPENAD
# ifdef ALLOW_AUTODIFF
Expand Down
2 changes: 1 addition & 1 deletion model/src/the_model_main.F
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ SUBROUTINE THE_MODEL_MAIN(myThid)
# include "tamc.h"
#endif
#ifdef ALLOW_CTRL
# include "ctrl.h"
# include "CTRL.h"
# include "optim.h"
#endif

Expand Down
4 changes: 2 additions & 2 deletions pkg/admtlm/admtlm_bypassad.F
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ subroutine admtlm_bypassad( myThid )
#include "EEPARAMS.h"
#include "PARAMS.h"
#if (defined (ALLOW_ADMTLM) && defined (ALLOW_BYPASSAD))
# include "ctrl.h"
# include "ctrl_dummy.h"
# include "CTRL.h"
# include "CTRL_DUMMY.h"
# include "optim.h"
# include "adcost.h"
# include "g_cost.h"
Expand Down
2 changes: 1 addition & 1 deletion pkg/admtlm/admtlm_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SUBROUTINE ADMTLM_DRIVER( myThid )
# ifdef ALLOW_AUTODIFF_TAMC
# include "tamc.h"
# endif
# include "ctrl.h"
# include "CTRL.h"
# include "optim.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion pkg/admtlm/admtlm_dsvd.F
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ subroutine admtlm_dsvd ( mythid )
# ifdef ALLOW_AUTODIFF_TAMC
# include "tamc.h"
# endif
# include "ctrl.h"
# include "CTRL.h"
# include "optim.h"
# include "cost.h"
# include "adcost.h"
Expand Down
2 changes: 1 addition & 1 deletion pkg/admtlm/admtlm_dsvd2model.F
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ subroutine admtlm_dsvd2model(
#include "PARAMS.h"
#include "GRID.h"

#include "ctrl.h"
#include "CTRL.h"
#include "optim.h"

#ifdef ALLOW_COST
Expand Down
2 changes: 1 addition & 1 deletion pkg/admtlm/admtlm_init_fixed.F
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subroutine admtlm_init_fixed( myThid )
#include "EEPARAMS.h"
#include "PARAMS.h"
#ifdef ALLOW_ADMTLM
# include "ctrl.h"
# include "CTRL.h"
# include "ctrl_weights.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion pkg/admtlm/admtlm_model2dsvd.F
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ subroutine admtlm_model2dsvd(
#include "PARAMS.h"
#include "GRID.h"

#include "ctrl.h"
#include "CTRL.h"
#include "optim.h"

#ifdef ALLOW_COST
Expand Down
16 changes: 8 additions & 8 deletions pkg/autodiff/active_file_control.F
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SUBROUTINE ACTIVE_READ_3D_RL(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -234,7 +234,7 @@ SUBROUTINE ACTIVE_READ_3D_RS(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -408,7 +408,7 @@ SUBROUTINE ACTIVE_READ_1D_RL(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -573,7 +573,7 @@ SUBROUTINE ACTIVE_READ_1D_RS(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -736,7 +736,7 @@ SUBROUTINE ACTIVE_WRITE_3D_RL(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -857,7 +857,7 @@ SUBROUTINE ACTIVE_WRITE_3D_RS(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -977,7 +977,7 @@ SUBROUTINE ACTIVE_WRITE_1D_RL(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down Expand Up @@ -1106,7 +1106,7 @@ SUBROUTINE ACTIVE_WRITE_1D_RS(
#include "EEPARAMS.h"
#include "SIZE.h"
#include "PARAMS.h"
#include "ctrl.h"
#include "CTRL.h"

C !INPUT/OUTPUT PARAMETERS:
C activeVar_file :: filename
Expand Down
Loading

0 comments on commit 83d6e05

Please sign in to comment.