Add macromolecular growth parameterization - #9
Merged
Conversation
# Conflicts: # pkg/darwin/darwin_plankton.F
zhenwu0728
added a commit
to zhenwu0728/darwin3
that referenced
this pull request
Mar 23, 2026
* more Momentum options, mostly related to hFac (#809)
* New Coriolis option "selectCoriScheme = 4"
This switch allows to compute Coriolis terms, both horizontal (in 2.Omega.sin(Phi))
and NH (in 2.Omega.cos(Phi)), using the averaged transport (with face edge length
and hFac factor), as done previously in V.I. for horizontal Coriolis.
* Change vertical advection for deepAtmosphere=T
For deep-model, absorb the NH-metric terms w.(u,v)/r into vertical advection
by advecting the product "deepFac x (u,v)" (instead of just u,v).
* improve new comments
* Adjust NH coriolis (new, selectCoriScheme=4) expression
- Add recip_hFacW/S (previously commented out) in new expression
(selectCoriScheme=4) of NH coriolis f'*W term
- remove hFacW/S from gW-Cori in selectCoriScheme=4 code and keep previous
selectCoriScheme=4 code (with hFacW/S) under selectCoriScheme=6 block
* New Spherical Metric term expression
- New Spherical-Metric term form using grid-spacing finite differences (instead
of analytical tan(Phi)/rSphere), supposed to improve both AM and KE conservation.
Used (turned on) when selectVortScheme=1,2.
- Add option to absorb the spherical-metric terms uMetricTerms = u.v.tanPhi/r
into meridional advection by advecting the product "dxC x u" (instead of just u).
Used (turned on) when selectVortScheme=2.
Note: for now, re-cycle Flux-Form unused param "selectVortScheme" for this.
* Adjust again gW-Cori just for the case selectCoriScheme=6
This option (selectCoriScheme=6, in mom_w_coriolis_nh.F) was left from early
test, with hFacW/S multiplying uVel,vVel, but without scaling by any recip_hFac.
The changes here fix this issue as the gW-Cori term is now divided by the
grid-cell thickness at the wVel location (new argument recip_rThickC).
* Refine changes to vertical advection for deepAtmosphere=T
Two improvements:
- single CPP option "MOM_USE_OLD_DEEP_VERT_ADV" in MOM_COMMON_OPTIONS.h to
disable changes to vertical advection for deepAtmosphere=T
- fix for the case useNHTerms=F with deepAtmosphere=T.
Done by keeping a local copy of deepFacC in MOM_VISC.h, and adding 1 new
argument to S/R mom_u_adv_wu.F, mom_v_adv_wv.F, mom_vi_{u,v}_vertshear.F
* Add new choice for vorticity advection, without r_hFacZ
This new option (with selectCortScheme=4) skip the division of vorticity
by hFacZ and replace it with tendency scaling by recip_hFacW/S
Also:
- remove code related to "upwindVort3" (was hard-coded to FALSE)
- add some missing "_d 0" ; + minor indentation changes
* use new parameter "select3dCoriScheme"
no need to hack selectCoriScheme params and leave mom_vi_coriolis.F unchanged
* use new parameter "selectMetricTerms"
- no need to hack selectVortScheme param
- compute advection tendency in separated block if selectMetricTerms
This makes sure results will not be affected (at trucation level)
with current default metric-terms.
- minor cleaning in mom_u/v_coriolis.F and mom_u/v_adv_wu/v.F
* add diagnostics for Metric-Terms tendency
* add diagnostics for Metric-Terms tendency
also rename 2 local variables (vF & v4F) more inline with other S/R
and improve description
* report new selections in config-summary
* add secondary deep-model test
using vector-invariant momentum
* Update ref. output + add new one
With deep-model, gU,gV NHMtTerms have been moved inside vertical momentum advection
and this affects results (11 remaining matching digits for cg2d); update primary test
ref. output and add ref-output for new (vector-inv) secondary test.
* add/edit new parms into ch 3 namelist tables
* switch order
* Fix missing setting of deepFacAdv
for the case where MOM_USE_OLD_DEEP_VERT_ADV is defined and useNHMTerms=F
(spotted by @owang01)
* remove un-used "metricTerms" logical
* more consistent use of "halfRL"
* document new momentum discretisation options
---------
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-31-151-35.dyn.MIT.EDU>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-29-216-126.dyn.MIT.EDU>
* Fix bug in gluemncbig caused by new numpy casting rules
* Fix fortran output format + 1 prepare_run (#920)
* add this file for multi-threaded test
* remove first part, not needed anymore
left from PR #885, remove the first part that was added (and documented) as:
"Temporary solution (until all files got moved here):"
* add missing comma in output format
fortran output format "1XI6" produces run-time error when compiled with
gfortran version 15.
* document 2 small fixes
* Longstep with GMREDI (#882)
* LONGSTEP+GMREDI, working version
* assign LS_PsiX(Y) as COMMON
* preparing_pull_request
* added ifdef block to avoid compiling error
* added ifdef for GM_BOLUS_BVP
* Fix compilation with #undef GM_BOLUS_ADVEC
and #define GM_BOLUS_BVP ;
and bring back original GMREDI_OPTIONS.h
* Fix description (comments)
* add LS_PsiX/YCount to common block
Also:
- remove GM_EXTRA_DIAGONAL from this header file
- merge few GM related common blocks (only 3 left).
* fix and simplify
- fix so that it compiles even if pkg/gmredi is not compiled
- remove all ALLOW_EDDYPSI code.
* improve speed
skip corresponding call when GM_ExtraDiag or GM_AdvForm are turned off
* simplify (+ clean-up)
* document adding remaining GM-Redi coeff to pkg/longstep
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Add separate NO3, NO2 and NH4 runoff forcing
* more bgc TAF store directives (#917)
* fewer hidden recomputations in the main routines
The only routines that are left for recomputations are those providing
the carbon chemistry coefficients, which are (even in my opinion) just
too many to store
* comment unnecessary includes, remove single "'" for fewer warnings
* document more TAF store dir in BGC pkgs
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* typos found along the way (2025) (#922)
* typos found along the way (2025)
* redact equation clean-up
* fix more typos in comments
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* undo f90-type syntax in subroutine as new version of tapenade generates an f90 source file
* document small fix in pkg/streamice
* penetrating shortwave fraction as a 3D-field (#750)
* introduce global field SWFrac3D that is computed once
- to be used as a lookup table during the timestep
- may be used to included BGC-contributions to light attenuation
- so far, KPP is not included in this
* cleanup: remove SWFracB entirely from pkg/seaice
* add flag KPP_USE_SWFRAC3D to use precomputed SWFrac3D
instead of computed SWFRAC locally. This changes results. Use AD of
1D_ocean_ice_column as a test for the new flag
* replace local swfrac computation by precomputed SWFrac3D field
and test this code in cfc_example by defining SHORTWAVE_HEATING (not
used, i.e. does not change results)
* revert model/inc/CPP_OPTIONS.h to original state, add local version
to cfc_example to test pkg/layers/SHORTWAVE_HEATIING related
changes (fix previous error)
* fix a small bug for Nr=1 with pkg/seaice
* increase k-size of SWFrac3D to Nr+1 and adjust logic
to retain the symmetry between z- and p-coordinates. Simplifies code
in many places
* introduce runtime parameter selectPenetratingSW
0: do not allow penetration below surface layer
1: allow constant-in-time penetration below surface layer
2: allow time dependent penetration below surface layer according to
local attenuation (not implemented)
default = 0 if SHORTWAVE_HEATING undefined and 1 if defined
* use new parameter selectPenetratingSW in pkg/seaice and pkg/kpp
* adjust field and parameter descriptions and definition
* revert because it still works without the change
and because this file is deprecated and should not be developed any
further
* change IF selectPenetratingSW from .GE. 0 to .GT. 0
to make selectPenetratingSW==0 equivalent to
undef SHORTWAVE_HEATING (as intended)
* adjust condition to selectPenetrating .GT. 0
* revert file because change causes differences due to truncation
* always load Qsw from file, if file exists
* revert back all changes
* bring back selectPenetratingSW
to be consistent with APPLY_FORCING_T, only remove Qsw if selectPenetratingSW > 0
* use same method as in external_forcing_surf.F to in-/exclude Qsw
* minor: skip loops if not needed
* unsensitive to z or p origin
Take care of case where seaLev_Z <> 0 (in z-coord.) or top_Pres <> 0 (in p-coord)
since, for consistency, SWFrac3D needs to be exactly 1 at the top.
* revert line breaks in comments
* change "KPPfrac" definition
to be the fraction of Short-Wave flux heating the mixing layer, i.e.,
"new KPPfrac" = 1 minus "old KPPfrac"
* change to also work with "#undef SHORTWAVE_HEATING"
* replace new KPP_USE_SWFRAC3D flag by runtime flag
* linear interpolation of SWFrac3D/swatt between interfaces
* adjust store directives
* clean up kpp_calc.F before it becomes more complicated again
- replace work-arrays where possible, because their re-use confuse TAF
- rename work array work2 into sdens (surface density)
- new work array workf to compute swfrac; the double use of worka
confuses TAF
- adjust comments
- adjust store directives to avoid recomputation of most of kpp_calc
- fix a store directive bug (store KPPhbl(:,:,bi,bj) instead of KPPhbl)
* adjust store directives and add some comments
many store directives can be avoided by incomplete statements for
worka; the re-use of worka and the fact that it is used input/output
of swfrac causes a lot of headache
* improve new param description
also remove one commented line (left from previous version)
* remove old commented out lines
both dQdT and EP_FLUX vars have been commented out for > 12.yrs, waiting for
corresponding code to show up. That did not happen so decide to remove all
these commented out lines.
* fix and simplify
In case Nr=1, using kSrfS=2 (instead of 1) is better as all penetrating Short-wave
should warm the ocean (and not beeing lost).
* change _RL to _RS for coriol and swatt to match (new) input
* change order of signs, fix typos, move declaration of kbl
into ifdef SHORTWAVE_HEATING block, as we only need it there.
* use KPPuseSWfrac3D interpolation code (changes results)
* switch to compile with #undef SHORTWAVE_HEATING
- since no short-wave was provided, not expecting any differences ;
- allows to check that pkg/kpp compiles with #undef SHORTWAVE_HEATING
(was not tested before) ;
- and since SHORTWAVE_HEATING was the only setting that was different from
default CPP_OPTIONS.h, no need for a cusomized CPP_OPTIONS file anymore.
* avoid un-used variables
* update reference outputs
from test experiment "1D_ocean_ice_column" (KPPuseSWfrac3D=T in "data.kpp")
and from experiment "global_ocean.cs32x15" (in_p & seaice tests).
* document Short-wave heating improvement
* no local version of CPP_OPTIONS.h
this means we will continue to check that LAYERS_THERMODYNAMICS code
compiles without SHORTWAVE_HEATING defined
* minor tweaks
---------
Co-authored-by: Jean-Michel Campin <jmc@ocean.mit.edu>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* new tag "checkpoint69f"
* Diel vertical migration (DVM) (darwinproject#6)
Add diel vertical migration code
---------
Co-authored-by: Oliver Jahn <jahn@mit.edu>
* Change default darwin_chlIter0 to PTRACERS_Iter0
* NetCDF file handling for profiles+grdchk (#887)
* nc file handling for prof+grdchk
* replace debugging statements by subroutine call
currently the output is controlled by debugLevel .GE. debLevA, but
this could be moved out of the routine to save time (?)
* remove (now) superfluous declaration of msgBuf
* remove (now) unused variable
* I am sorry, I just had to make the indentation marginally consistent
It makes it a little easier to read this very long file.
The error message for some instances (e.g. ESCO 20) is changed to a
print statement to STDOUT
* make filename handling a little safer (fnamequinc), hopefully
* adjust flow directives
* improve message to STDOUT and add some indentation and formatting
* num_var iterator; init 6 error to print
* print on debug level a
* alway add actual length of "*fnameequinc"
* fix declaration of input filename "file2" length
This is necessary when the filenames are passed with the actual length.
* indent JL
* macro and indentation
* close netcdf files with model equivalents of observation
fidforward, fidadjoint, fidtangent
* use NF_SYNC instead of NF_CLOSE/NF_OPEN sequence
more error handling, remove (now) unused variables
* replace 0 by NF_NOWRITE, improve (?) error message
* ALL CAPS formatting
* 2 space indent; source code headers
* nf_sync init_varia
* descriptive iterators; consistent in pkg/profiles
* move utils to seperate file
* rename nc close sr
* nf error messaging upgrade
* id -> Id
* zlength iterator; organize local variables
* rm trailing spaces
* rm typos for compiling
* 🦖 70 col allowance
* loop description
* rm unused local variables; minor spacing
* sync fidtangent in init_varia as well
* check if file is open before closing and editorial changes
* small changes and fixes to the error handling
* address some of my own comments
* Update pkg/profiles/profiles_readvector.F
Co-authored-by: Martin Losch <30285667+mjlosch@users.noreply.github.com>
* fix so that it compiles
* rename cost_profiles.F into profiles_cost.F
* fix use of _BARRIER, _BEGIN/END_MASTER and loops in a few cases
* add missing profiles_cost.F, this belongs to 287ecf4
* fix to enable to compile
with #define ALLOW_PROFILES_SAMPLESPLIT_COST
fix typo and undefined variable "m"
* permute arg. myTime & myIter in S/R PROFILES_COST
also:
- remove resetting of myIter & myTime a second time (in the_main_loop.F)
- remove some ".EQV.TRUE."
* remove some ".EQV.TRUE."
* minor
- more consistent spelling
- remove few consecutive blank lines
* adjust MASTER threads sections
to move call to GLOBAL_SUM outside single-thread blocks
* add a comment about multi-threads to fix
* add some comments, change indentation, reduce # of line breaks
The intention here is to improve the readabilty of this very long
routine. It is still very difficult to read.
* replace loop counters c,q by ic,iq, simplify if-condition
* finish renaming "c" -> "ic"
* switch on "profilesDoNcOutput"
so that this get tested with pkg/grdchk (with TAF AD & TL and with Tapenade)
* document fixing pkg/profiles NetCDF output
---------
Co-authored-by: mjlosch <Martin.Losch@awi.de>
Co-authored-by: Martin Losch <30285667+mjlosch@users.noreply.github.com>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* `pkg/timeave` or "#undef EXACT_CONSERV`" no longer compiled in any verification exp. (#926)
* switch to "#define EXACT_CONSERV"
* remove pkg/timeave params from all "data*"
* turn off pkg/mnc in 2 test experiments
* do not compile pkg/timeave anymore
in any test experiment ; also skip pkg/mnc in 3 test exp
* add a warning it using pkg/timeave
* fix to enable to run with recent code
- need to specify "useOffLine=.TRUE.," in "data.pkg" (since March 2006)
- need to remove "iceFile" and "windFile" from "data.gchem" (since April 2008)
- need to specify "ivdc_kappa" > 0 to use pkg/offline "ConvFile"
* minor: fix comments
* minor (trailing blank ..)
* add a short "README"
* remove un-used "data.mnc" file
* document verification exp. update
* modify streamice pickup write to ensure active variables are written correctly (#932)
* modify to ensure active vars are written correctly
* just to trigger a new C.I. test
* change ifndef's OPENAD to ifdef
* document streamice pickup fix for OpenAD
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* fix "conftest.c" test program
for newer version of gcc
* set PROTOTYPES to 1 if not already defined
so that it continue to work with gcc v15
* document fixing mpack compilation
* fix initial NH-pressure in exp. short_surf_wave (#933)
* fix starting NH-pressure with implicSurfPress=1/2
run for 1 time-step (with implicSurfPress=1) and continue (i.e., restart)
from there using again implicSurfPress=1/2 for 11 remaining time-steps.
* fix typo
* avoid unused variables
* adjust Tapenade version report to summary
Add the date of the Tapenade release to the Tapenade-version in summary
since the "version" by itself does not carry real information about
which version of Tapenade is used.
* remove few commented out lines
* document fix/update of short_surf_wave test exp.
* new tag "checkpoint69g"
* Enabling spatially varying (2D) Kd (#928)
* Enabling spatially varying (2D) Kd
* Enabling spatially varying (2D) Kd
* Enabling spatially varying (2D) Kd
* Enabling spatially varying (2D) Kd
* Enabling spatially varying (2D) Kd
* remove trailing blanks
* Enabling spatially varying (2D) Kd
* minor simplifications
- adjust "atten" expression (k0_2d factor multiply the avaraged drF*hFacC thickness)
- use "^C" more consistently for text comments
- adjust description of "bling_k0_2dFile" in BLING_VARS.h
* document adding bling_k0_2dFile
---------
Co-authored-by: wangy0m <wangy0m@KW60844.kaust.edu.sa>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Remove CPP option EXACT_CONSERV (#930)
* check if EXACT_CONSERV is set in CPP_OPTIONS.h
and STOP if it's #undef and issue a Warning if it's #define
* remove EXACT_CONSERV (CPP) condition
and keep only code formerly within #ifdef EXACT_CONSERV
* remove EXACT_CONSERV (CPP) condition
and keep only code formerly within #ifdef EXACT_CONSERV
* remove EXACT_CONSERV setting
* minor indentation
* remove EXACT_CONSERV (CPP) condition
also in customized copy from verification code dirs.
* bring local version up-to-date
* cleaning
remove commented-out store directive for non-existent variable
* document removing CPP option EXACT_CONSERV
* fix duplicate defining kSurface
* document fixing compilation of seaice_growth_adx.F
* Second round to fix startrec for xx
* fix record shift in xx_*.effective file
File xx_*.effective contains only a sub-set of full control-adjustment time-series,
that corresponds to this simulation. This modification fixes the shift in record-number,
which was ignored in master branch and was not working for all cases in previous version.
Also enable some debug print (if debugLevel >= 3) that were un-usable before (ECCO_VERBOSE
never defined since ECCO_OPTIONS.h was not included).
* add missing DEBUG_CALL
* document fix in ctrl_get_gen_rec.F
* just to trigger an other CI test
* new tag "checkpoint69h"
* Add new diagnostics for square of vertical shear (#937)
* add diagnostics for square of vertical shear
- new diagnostics "VSHEARSQ" for M^2 (square of horiz. velocity vertical shear)
- also adjust few surface diag description (more consistent)
* fill new diagnostics "VSHEARSQ"
* improve consistency in diagsUnits
* adjust title of 3 diagnostics
* document adding diagnostics "VSHEARSQ"
* fix Tapenade Makefile (#935)
* fix Tapenade Makefile
Put all adjoint (or Tang.Lin) tapenade generated fortran files "*_b.f" (or "*_d.f")
into a single "adj/tlm/_tap_all.f" file ; compile this file to generate an
object file that is used at the link stage to produce the executable:
- no need to "touch" the "*_b.f" (or "*_d.f") ; remove the .PHONY targets.
this avoids to re-process all file through Tapenade and recompile when
nothing has been updated (restore the purpose of a Makefile).
- could use specific compiler options for compiling vs link stage
* add an "-ncad" for Tapenade Makefile
Similar to "-ncad" for TAF Makefile, avoid putting all AD code in a single file
and instead append FWD individual src file to corresponding Tapenade-generated AD file.
* sort out `adStack.c` and `abBinomial.c` cases:
remove specific lists `TAPENADE_SUPPORT_C_SRC_FILES` and `TAP_SUPPORT_OBJFILES`
and link a subset of files from `tools/ADFirstAidKit/` directly into build dir,
the same way all links to build dir are done in `genmake2`.
* simpler solution for adStack.c & abBinomial.c
put symbolic-links in pkg/tapenade/
* add description/comments
* changes required to make this work on case-insensitive filesystem
- e.g. for MacOS (where this was tested)
- replace default extension ".f" by ".$FS" in AD_FILES (could also be
done in more places for consistency)
- add hard coded suffix rule ".f.o".; if FS=f then this will lead to
having this rule twice, so we could think of a more clever way of
doing this
- replace "*_b.f *_d.f" by "\$(AD_FILES_ADJ) \$(AD_FILES_TLM)" in
AD_CLEAN; probably has no effect as I do not see where this is
used (but it should be)
- back out extension FS for list of files passed to append_fwd_src and
use it
* replace adj/tlm_tap_all.f by adj/tlm_tap_all.$FS
more consistent and maybe even safer, can use the rule for .$FS.o instead
of hard coded .f.o-rule
* refine description of how to run tapenade with MITgcm on a Mac
with docker. This may actually also apply to other platforms because
there is nothing specfic for MacOS (but not tested).
* alternative way of dealing with ".for" suffix
special case when Fortran suffix ".for" is used instead of ".f" is done
in "append_fwd_src" where output is renamed to _b.$FS or _d.$FS
* permute append_fwd_src first 2 arguments
* add a somewhat complicated TAPENADECMD to MacOS build option file
basically a docker command that requires docker to be running, but
circumnavigates issues with absolute paths in combination with command
tapenadocker (see documentation). With this build options file I can
run the tapenade experiment with docker "out of the box"
* document fixing Tapenade Makefile
---------
Co-authored-by: mjlosch <Martin.Losch@awi.de>
* Remove timeave package (#939)
* remove timeave params from PARAMS.h
- disable taveFreq & tave_lastIter from ini_params.F
- remove taveFreq outside ALLOW_TIMEAVE blocks
- disable each pkg timeave param (for now, not yet removed from pkg header file)
* remove ALLOW_TIMEAVE blocks from model/src
* remove un-used header file
* remove pkg/timeave dir
* remove DO_STATEVARS_TAVE flow dir.
* remove all pkg/timeave related code
* remove more TAVE
* remove do_statevars_tave from "flow_tap"
* remove MNC variable definition for timeave fields
left behind from when pkg/aim_v23/aim_write_tave.F
and pkg/ocn_compon_interf/cpl_output.F were removed
* update/clean-up comments
* remove "timeave_mnc" from all "data.mnc"
note that "timeave_mnc" setting was already commented out.
* remove "SEAICE_tave_mnc" from all "data.seaice"
note that "SEAICE_tave_mnc" setting was already commented out.
* document removing pkg/timeave
* set fcb to 1.0 only on root process
* also initialise TAF adfc
for other than myProcId=0
* document fixing Tapenade MPI adjoint
* Add type-averaged limitation diagnostics
* new tag "checkpoint69i"
* Bug-fix in pkg/seaice EVP solver (#929)
* Update SEAICE_OPTIONS.h
Add CPP flag “SEAICE_EVP_REGULARIZE_DENOMUV” for the regularizations in the calculation of denomU/V
* Update seaice_evp.F
Add two regularizations in the calculation of denomU/V
* Update SEAICE_OPTIONS.h
* Update seaice_evp.F
* Update SEAICE_PARAMS.h
Add a run-time flag for regularizations in EVP
* Update SEAICE_PARAMS.h
* Add a run-time flag for regularizations in EVP
* Add a run-time flag for regularizations in EVP
* Add a run-time flag for regularizations in EVP
* Add a run-time flag for regularizations in EVP
* Add a run-time flag for regularizations in EVP
* Add a run-time flag for regularizations in EVP
* Add a run-time flag for regularizations in EVP
* add verification experiment for SEAICEevpRegDenomUV=T
- setting the flag changes results dramatically (only 2-3 digits of
agreement remain)
* sneak in small modification: do not write coastRoughU/V if not used
in order to reduce unnecessary files on the disk
* Update SEAICE_PARAMS.h
* Update SEAICE_PARAMS.h
* Update seaice_evp.F
* Update seaice_readparms.F
* Update seaice_summary.F
* Update data.seaice
* Update seaice_readparms.F
* Update seaice_summary.F
* make sure that default does not break existing setups
adjust description, add documentation
* minor: update comments
* new output from ref. platform
* document pkg/seaice new EVP parms.
---------
Co-authored-by: mjlosch <Martin.Losch@awi.de>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Correct `pkg/mnc` grid parameter naming (#925)
* pkg/mnc grid case to match mds
* r_unit naming convention from mds
* grid names to match `xmitgcm`
* revert vars to match MDS+`xmitgcm` grid output
* consistent grid naming in pkg/mnc
* update MATLab utility
* missed an rC
* missed extra grid writing
* fix reading new MNC grid-files
* small and unimportant adjustment for consistency
* simple mnc key restore for Python
* tutorial_bcg utilitiesw
* small adjustment to isomip gendata.m
* document renaming MNC grid-variables
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
Co-authored-by: mjlosch <Martin.Losch@awi.de>
* `pkg/grdchk` locate points spanning k-levels (#943)
* spacing
* span multiple depth levels in pkg/grdchk
* TLM verification problem with results
* rm ESCO comments
* remove all files that are identical to their input_ad versions
* Update pkg/grdchk/grdchk_loc.F
Co-authored-by: Martin Losch <30285667+mjlosch@users.noreply.github.com>
* generic comment
* grdchk layers as it's own experiment
* merge grdchk layers into kapredi verification test
* remove trailing blank
* update/add comments
* add a short matlab script example
that, given "step", finds grdchk location
* new reference output from "villon"
* a python version of the new matlab script
* document fixing multi-level grdchk
---------
Co-authored-by: mjlosch <Martin.Losch@awi.de>
Co-authored-by: Martin Losch <30285667+mjlosch@users.noreply.github.com>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Enable STREAMICE fixed-point treatment and other functionality with TAPENADE tool (#927)
* 1st change to update tapenade capabilities for streamice (hand adjoint of cg solve, FP treatment)
* more changes to implement FP loop
* ensuring that verification runs and gives reasonable values
* fixed point pragma on single line for residual decrease property
* add logic to include streamice_cg_solve.f in tapenade command, only when streamice package is used
* added flow commands in extra tap flow file
* remove tap_dontcompile as in main branch
* stashing changes
* reverse popping of velocity arrays
* new BWD s/rs for nocheckpoint mode, streamlining of calls to adstreamice_cg_solve to avoid recalculation, modifying fixed point convergence check, genmake2 updates to specify tapenade cmd line flags, linking libraries, and addl flags for adFixedpoint.c
* before malking evern more chg:
* Thwaites experiment runs with both tapenade and openad
* more updates to ensure verification experiments work
(and are somewhat accurate on ARCHER)
* modifying global sum call
* remove matdestroy commands
* make adjoint seed unique to proc 0
* Revert output_tap_adj.txt.gz to previous state
* Update genmake2
* apply dos2unix on 3 files
* fix issue with non-streamice tapenade; (temporarily) update results file for halfpipe_streamice
* minor cleaning
remove trailing blanks and use tab consistently
* attempt: use tapenade flow file and set XTRATAPFILE to '' (to be removed) in genmake2
* remove change to cost_dependent_init.F from this pull request
* remove changes to genmake2, active_read/write_tap, exch_tap_b from this pull request, as well as non-streamice changes to stubs_tap_adj
* add comment on commented-out function from L Hascoet
* remove tabs and trailing blanks
* rename streamice_vel_solve_openad to streamice_vel_solve_fp
* merging OAD_FP and TAP_FP cpp variables into a single ALLOW_STREAMICE_FP_ADJ
* replacing fixed-point CPP variable in verification code folders
* fixing issues from CPP replacement
* replace cpp commamd in oad template
* fixing CPP commands in add'l overlooked oad templates
* split control blocks by variable type
* Update STREAMICE_FP.h
Remove unneeded include
* Update STREAMICE_OPTIONS.h
Comment explaining ALLOW_STREAMICE_FP_ADJ cpp variable
* avoid unused variables
* remove trailing blanks
and consecutive blank lines
* reduce differences with version in pkg/streamice
* update reference output:
- TAF-adm reference output from villon (Ubuntu)
- Tapenade-adj ref. output from baudelaire (FC.42)
* for now, disable Tapenade Tang-Lin test.
since gradient-check are not right.
* remove obsolete (and commented out) lines
* document pkg/streamice Fixed-Point with Tapenade
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Add macromolecular growth parameterization (darwinproject#9)
Co-authored-by: Oliver Jahn <jahn@mit.edu>
* Default bioswimDVM to zero
* Add missing STOP (SHORTWAVE_HEATING & fluidIsAir) (#951)
* STOP if selectPenetratingSW is used with fluidIsAir
and adjust default to avoid hitting a stop
* minor
* document adding a stop
* Fix nested DO-IF loops in seaice_solve4temp.F
The loop structure is mismatched: the inner `IF` is closed before the `DO` loops, instead of the other way around. This commit fixes this bug.
* document SEAICE_MODIFY_GROWTH_ADJ compilation fix
* Merge global_ocean_ebm into global_oce_latlon. Step1: make experiments as similar as possible (#944)
* make code_ad very similar between global_oce_latlon/ocean_ebm
These changes do not change the results of the verification
experiments
* add input_ad.ebm, uses global_ocean_ebm/input forcing files
matches global_ocean_ebm/results/output_adm.ebm.txt as reference if
CD_CODE_NO_AB_MOMENTUM and CD_CODE_NO_AB_CORIOLIS are defined in
CD_CODE_OPTIONS.h
* add adjMonitorFreq and adjust monitorFreq
* add reference results for AD-ebm experiment
* copy FWD experiments of global_ocean_ebm to global_oce_latlon
- global_ocean_ebm/input.w_exf -> global_oce_latlon/input
- global_ocean_ebm/input -> global_oce_latlon/input.ebm
- global_ocean_ebm/input.yearly -> global_oce_latlon/input.yearly
small issue: as there is already a prepare_run-script in
global_oce_latlon/input, this is also used in tr_run.ebm, I don't know
how to suppress that.
* remove all new input & input.* files
duplicated copy from global_ocean_ebm
* add symbolic-links for new input dirs
* more robust
so that it will continue to work when "global_ocean_ebm" experiment is removed
* turn on monitor and AD monitor
* remove all new input_ad.ebm files
* add symbolic-links for new input_ad.ebm dir
* back to original SIZE.h
and gerenate new output_adm.ebm.txt on ref machine
* use default CD_CODE_OPTIONS.h
also do not compile exf, ggl90 and mnc pkgs
and gernerate new reference output_adm.txt (from ref. machine)
* back to original version
since updated versions (from global_oce_latlon/code_ad) do not affect the output
* replace fwd output with sym-link
* replace 1 output_adm with sym-link
+ adjust previous symbolic-links
* disable "global_ocean_ebm" tests
and document merging of exp. "global_ocean_ebm" into "global_oce_latlon"
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* ObsFit: a new cost function implementation for arbitrary observations (sparse, irregular, integrated, etc) (#875)
* new package
* new package
* Update data.pkg
* Fix indentation
* Add README
* turn extra obsfit code/input into proper "secondary" AD experiment
* Update input file
* Remove commented lines
* Remove writing misfits to file that causes TAD errors
* rename README file
* Uncomment generic/LLC grid error
* added some formatting
* put back netcdf function call with proper flow directivs
- remove unused variables
- some formatting
* change control variable
* Formatting
* Fix offset calculation
* Draft obsfit entry for mitgcm manual
* LLC grid compatibility
* Adding reference output
* Ivana's fix for TL
* Rename cost_obsfit to obsfit_cost
* initial pass on doc edits/formatting
* Bug fix: tmp_type replaced with type_cur
* Remove unused variables
* Rename active_file_obsfit* to obsfit_active_file*
* doc edits in progress
* Adding forward verification experiment with obsfit
* doc edits continued
* doc edits continued
* doc edits continued
* Improve verification experiments
* Remove adjoint recomputation
* minor edits from averdy
* minor doc edits
* Updates to the manual entry
* new cost function for gradient check
* set up equivalent gradient check with profiles instead of obsfit
* replace accidentally deleted file
* Replace accidentally deleted file
* Replace accidentally deleted file
* updates to verification experiment
* fix gradient check for global_oce_biogeo_bling.obsfit
* fix store directives and recomputations in S/R obsfit_cost
It is not clear to me, why in comparison to s/r cost_profiles, the
store directives are necessary. I think that variable obs_modmask
should be an array (but that does not help either) and I think that
the mix of formal parameters and common block variables in
obsfit_active_file*.F does not help.
* define new tape also for divided adjoint
* Adapting recent changes to pkg/profiles
* formatting
* Fix nc files read
* Edits to manual
* fix recomputations without breaking the result by modifying the code
in obsfit_cost.F:
- make the tape local (no s/r obsfit_costmd, remove from the_main_loop.F)
- recompute obs_modmask when it is used
- use obs_modval==spval as a mask
- introduce local parameter spval = -9999. _d 0
* Fix a bug that comes up when starting from a pickup file
* obs_modmask changed from global to local variable
* adjust flow directives and remove TAMC related hack
and an unnecessary include statement
* small adjustment
* continue recent incorporating changes to pkg/profiles
* Formatting
* new reference output from villon
* change argument list of 3 subroutines
- add myIter arg to S/R OBSFIT_INLOOP and OBSFIT_SAMPLING
- change order of arg for S/R OBSFIT_COST
- minor cleaning (remove trailing space, ...).
* cleaning
- remove trailing blanks, lower/upper case, spacing, indentation
* remove un-used variables
* cleaning
- remove trailing blanks, lower/upper case, spacing
* remove unnecessary input folders
* add dependence to pkg/cal
* Fix netcdf initialization
* Fix typos, netcdf files closing
* Indentation
* minor: use tab consistently
* remove trailing blanks (forgot this one)
* not needed anymore
since input_ad.profiles/ is gone
* remove duplicated files
all identical to input_ad/ version ;
and easier to maintain this way.
* Edits to the manual
* doucment adding new pkg "obsfit"
* Fix parameter for max no of samples; add error message
* Fix max samples number parameter
---------
Co-authored-by: mjlosch <Martin.Losch@awi.de>
Co-authored-by: Jean-Michel Campin <jmc@ocean.mit.edu>
Co-authored-by: JEFFERY SCOTT <jscott@JEFFERYs-MacBook-Pro.local>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-31-164-50.dyn.MIT.EDU>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-31-149-238.dyn.MIT.EDU>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-29-139-140.dyn.MIT.EDU>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Fix pr875 addition (#957)
* disable obsfit if NetCDF test fails
since netcdf.inc is directly included in obsfit pkg src within #ifdef ALLOW_OBSFIT
* fix call to OBSFIT_NF_ERROR
to get correct number of argument in S/R call
* drop ptracers 1 & 2 from comparison test
since these Ad-monitor stats are all zero
* Replace deprecated `ALLOW_SHIFWFLX_CONTROL` flag by `ALLOW_SHELFICE` in `optim`.
* document fixing obsolete CPP-option in optim
* new tag checkpoint69j
* Test tapenade experiments through continuous integration with github actions [resubmit] (#960)
* 1st attempt -- add tapenade testing section
* comment change to hopefully trigger CI
* alignment issue in tapenade section
* 1. create single input folder for tapenade -- as yml cannot combine input directories.
2. modify testreport flags
* adding dockerfile and README
* Get tapenade test image from mitgcm docker
* Download specific commit for Tapenade
* Build Tapenade
* Add global_oce_latlon experiment to tapenade testing
* Trigger retest
* Try with larger memory
* Increase mem one more time
* run with only global_oce_latlon
* Add '-nocat4ad' option to MITGCM_TROPT for tapenade
* restore testreport command for tapenade
* add nocat4ad to genmake_local
* Remove 'nocat4ad' option from MITGCM_TROPT
* trying isomip test instead
* add memory and remove devel flag
* fix bug
* try with global_oce_latlon adjoint again, inc memory more
* trying again with the inria produced docker image which is used in the darwin_arm64_gfortran optfile
* updating pull command
* Go back to mitgcm docker image
* Increase Java max heap size in docker run cmd
* remove genmake_local for global_oce_latlon, return -devel flag to tapenade github testing
* Set heap size to 2.5GB and remove from Dockerfile
* tapenade tests use "-ncad"
also remove "-devel" and increases matching to 14 (like other tests)
* update comments
* document adding tapenade tests to CI
---------
Co-authored-by: Oliver Jahn <jahn@mit.edu>
Co-authored-by: Daniel Goldberg <danielgoldberg@Daniels-MacBook-Air-76.local>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* new routine gchem_insolation replaces duplicate code in dic and bling (#948)
* new routine gchem_insolation replaces duplicate code in dic+bling
* adjust comments
* remove pkg/cal code and update comments
* change theCalendar to "model", add useCAL=T explicitly
* move call cal_set from cal_init_fixed.F to cal_readparms.F
since we may need some of the parameters that are set in cal_set.F
before cal_init_fixed.F is called from initialise_fixed.F.
I could not find any detrimental effect of this change.
* add consistency check between calendar and externForcingCycle
- soft warning (no stop) to STDOUT
- only if useEXF=F
* new runtime parameter gchem_secondsPerYear
defaults to 360*86400 seconds if useCAL=F
if useCAL=T:
- defaults to 365.25*86400 seconds days if Gregorian calendar is used
- defaults to nDaysNoLeapYear*86400 seconds otherwise
* suggestion for a gchem-configation summary (starting point)
* mv cal_set back to cal_init_fixed and adjust gchem_readparms
* adjustments following jm-c's suggestions
* more fixes and adjustments
* move warnings to STDERR
and adjust printed message
* document adding gchem_insolaton.F
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* skip report of unused params
* avoid unused variables
* Fix typo that prevents compiling with ALLOW_PROFILES_SAMPLESPLIT_COST
* document fixing typo in pkg/profiles
* Fix a bug in pkg/obsfit (#966)
* Typos
* Fix bug in vector size allocation
* Add comments to size allocations
* Fix comment wording
* document fixing allocation in obsfit_init_fixed
---------
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
* Remove "global_ocean_ebm" experiment (#963)
* move ref. output to new host exp. results dir
* move/remove input-dir links
* fix after input dir move
* skip if secondary test
* not needed (same as in ../input_ad)
* remove exp. global_ocean_ebm
* adjust/update README(s)
* minor adjustment to README
* outdated
* update list of experiments
* try to fix it
* back to original version
* fix/adjust docs and README
* an other adjustment
* insert blank lines before some blocks and mark up some text
* document removing "global_ocean_ebm" exp.
---------
Co-authored-by: mjlosch <Martin.Losch@awi.de>
* Fix CG target residual in W unit (#959)
* compute and store few more global quantities
including: number of surface wet-point, number of wet grid-point and
3-D mean grid-cell horizontal area.
* fix CG-Tolerance from CG-TargetResWunit
use correct scaling (exact scaling if rAc is uniform) in setting
cd2d and cg3d Tolerance so that solver convergence criteria is
when RMS of wVel error is below CG-TargetResWunit
* compile debugging code
but only used at highest debugLevel + highest printResidualFreq
* adjust cg2gTargetResWunit of FWD tests
increase cg2gTargetResWunit (by sqrt(N_xy)) to keep roughtly the
same CG-Tolerance as previously.
* adjust cg2gTargetResWunit of AD tests
increase cg2gTargetResWunit (by sqrt(N_xy)) to keep roughtly the
same CG-Tolerance as previously.
* switch off "cg2gTargetResWunit" in most AD tests
to use instead "cg2gTargetResidual" setting (normalize cg2d RHS),
except when using useNSACGSolver=T (in 3 tests);
and update the corresponding reference output.
* adjust new variable description
* document fixing CG target in W-unit
* forgot to update these in PR #959
* Fix typo in doc
* new tag "checkpoint69k"
* Check for DARWIN_BOTTOM_SINK when RADI is compiled
* Improve loop comment
* Update comment about volume computation options
---------
Co-authored-by: Jean-Michel Campin <jm-c@users.noreply.github.com>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-31-151-35.dyn.MIT.EDU>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-29-216-126.dyn.MIT.EDU>
Co-authored-by: Oliver Jahn <jahn@mit.edu>
Co-authored-by: Hajoon Song <hajsong@gmail.com>
Co-authored-by: Jean-Michel Campin <jmc@mit.edu>
Co-authored-by: Martin Losch <30285667+mjlosch@users.noreply.github.com>
Co-authored-by: Ivana Escobar <ivana@utexas.edu>
Co-authored-by: dngoldberg <31406058+dngoldberg@users.noreply.github.com>
Co-authored-by: Jean-Michel Campin <jmc@ocean.mit.edu>
Co-authored-by: daataniguchi <41418137+daataniguchi@users.noreply.github.com>
Co-authored-by: mjlosch <Martin.Losch@awi.de>
Co-authored-by: Yixin Wang <47778829+Alice-Wang-Yixin@users.noreply.github.com>
Co-authored-by: wangy0m <wangy0m@KW60844.kaust.edu.sa>
Co-authored-by: An T. Nguyen <atnguyen@ices.utexas.edu>
Co-authored-by: R. Song <amc2507@outlook.com>
Co-authored-by: shlomitsharoni <126613282+shlomitsharoni@users.noreply.github.com>
Co-authored-by: Hugo <72827017+livoire13@users.noreply.github.com>
Co-authored-by: averdy <44445771+averdy@users.noreply.github.com>
Co-authored-by: JEFFERY SCOTT <jscott@JEFFERYs-MacBook-Pro.local>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-31-164-50.dyn.MIT.EDU>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-31-149-238.dyn.MIT.EDU>
Co-authored-by: JEFFERY SCOTT <jscott@dhcp-10-29-139-140.dyn.MIT.EDU>
Co-authored-by: Hugo Lévy <hulevy001@vpn-172-26-3-195.awi.de>
Co-authored-by: Daniel Goldberg <danielgoldberg@Daniels-MacBook-Air-76.local>
Co-authored-by: averdy <averdy@ucsd.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes does this PR introduce?
(Bug fix, feature, docs update, ...)
What is the current behaviour?
(You can also link to an open issue here)
What is the new behaviour
(if this is a feature change)?
Does this PR introduce a breaking change?
(What changes might users need to make in their application due to this PR?)
Other information:
Suggested addition to
tag-index(To avoid unnecessary merge conflicts, please don't update
tag-index. One of the admins will do that when merging your pull request.)