E3SM-Project / E3SM

Energy Exascale Earth System Model source code. NOTE: use "maint" branches for your work. Head of master is not validated.
https://docs.e3sm.org/E3SM
Other
353 stars 362 forks source link

Time computation of forcing is incorrect for RK4 #5364

Open gcapodag opened 1 year ago

gcapodag commented 1 year ago

The time varying forcing and the tidal potential forcing have an explicit dependence on time t that is currently not modified during the intermediate stages of RK4 and this results in a deterioration of the temporal convergence rate to first order from the expected fourth order. The computation of the forcing in MPAS-O during the time stepping procedure is carried out only at the beginning of the time step and not at the intermediate time levels required by RK4.

I fixed this issue with @jeremy-lilly using a forcingTimeIncrement that takes into account the necessary additional contributions to the time level t, the changes are in this branch: https://github.com/gcapodag/MPAS-Model/commits/split_testing

Grep on forcingTimeIncrement once cloned and see this commit if in need of additional details: https://github.com/gcapodag/MPAS-Model/commit/9658985f48dcd93702ac5dbf6dc878140969e151#diff-86c132deabb5d64780bda599d5222d5b67468c5d0c18bee8cad90f8fc1e4e3f7

In the above branch the forward mode is also modified so that the call for ocn_time_varying_forcing_get is done within the forward mode only for split-explicit and not for RK4, see mpas_ocn_forward_mode.F after cloning the above branch.

As part of this fix we also modified the routine mpas_advance_forcing_clock to allow for more decimals when the dt is given in seconds.

sbrus89 commented 1 year ago

@gcapodag, thanks again for fixing this. It's been something that's been needing to be done for a long time now: https://github.com/MPAS-Dev/MPAS-Model/issues/375

cbegeman commented 1 month ago

@sbrus89 I've tested a branch of MPAS-Ocean that has the source terms needed to evaluate mom del2 and del4 (with eventual application to Omega). I'm finding that we have to get this PR in to evaluate those terms, otherwise the error due to the forcing dominates. Do you have the time to revive this PR? https://github.com/E3SM-Ocean-Discussion/E3SM/pull/55