Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamics: add implicit VP solver #491

Merged
merged 196 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
ccf9ba5
initial coding of ice_dyn_vp.F90
JFLemieux73 May 29, 2018
460d360
code (matvec, bvec and residual) now compiles after debugging
JFLemieux73 May 29, 2018
322b9c4
introduced calc_vrel_Cb and calc_visc_coeff subroutines and precond.F…
JFLemieux73 May 30, 2018
cbd7b8d
after debugging...now compiles
JFLemieux73 May 30, 2018
1195bc0
in process of adding precondD
JFLemieux73 May 30, 2018
a7074df
precondD is in progress
JFLemieux73 Jun 4, 2018
9363913
I finished coding precondD...it compiles
JFLemieux73 Jun 4, 2018
ae15ace
added calculation for L2norm
JFLemieux73 Jun 4, 2018
35babdd
modif to ice_step_mod.F90 for call to imp_solver
JFLemieux73 Jun 4, 2018
b793f7f
now form complete vectors by alternating u(i,j) and v(i,j) and so on
JFLemieux73 Jun 5, 2018
4a8a3f8
added simple routine to form a vector
JFLemieux73 Jun 6, 2018
a8eecfe
corrected bug for vectors of size ntot
JFLemieux73 Jun 6, 2018
8245a45
added vectors of size ntot to bvec and matvec
JFLemieux73 Jun 6, 2018
18fc896
step back...not so easy to form all the vectors for the blocks...
JFLemieux73 Jun 6, 2018
4a3e1f2
new subroutine for assembling ntot vectors
JFLemieux73 Jun 6, 2018
0690b1e
In the process of adding the call to fgmres
JFLemieux73 Jun 6, 2018
4dc1a09
new subroutine to convert vector to the max_blocks arrays
JFLemieux73 Jun 8, 2018
a5112d8
ice_dyn_vp compiles...I now need to make fgmres.F90 compile...
JFLemieux73 Jun 8, 2018
5cd50a8
added BLAS routines needed by fgmres
JFLemieux73 Jun 8, 2018
1d1eeb0
added the fgmres.F90 routine...does not compile yet...
JFLemieux73 Jun 8, 2018
bada6d7
minor modif to fgmres.F90
JFLemieux73 Jun 11, 2018
8901ccf
bug in call to arrays_to_vec instead of vec_to_arrays
JFLemieux73 Jun 11, 2018
89bf00a
Remove fgmres.F90 (MPI version, will re-add GEM version later)
phil-blain Jun 6, 2019
bc803ea
added serial fgmres for testing
JFLemieux73 Jun 12, 2018
c426123
modified code for serial tests
JFLemieux73 Jun 12, 2018
4e36b41
after debugging...
JFLemieux73 Jun 12, 2018
2139aef
added code to put sol vector in uvel and vvel arrays at the end of fg…
JFLemieux73 Jun 12, 2018
502bab0
modified tinyarea calc for VP (punyVP=2e-9)
JFLemieux73 Jun 13, 2018
f6be97e
modified location of allocation for some variables...
JFLemieux73 Jun 13, 2018
d7316c4
small bug corrected in allocating variables
JFLemieux73 Jun 13, 2018
def1bab
introduced capping of the viscous coeff following Kreysher
JFLemieux73 Jun 13, 2018
933fa43
added a relaxation to uvel,vvel to try to get nonlinear conv
JFLemieux73 Jun 13, 2018
9779b0c
modif to relaxation calc...minor
JFLemieux73 Jul 5, 2018
f7c276a
I found a bug in my 1st implementation. The dsig/dx term related to t…
JFLemieux73 Jul 5, 2018
aad62bf
Pr is now calc with zeta
JFLemieux73 Jul 9, 2018
1eb6373
dPrdx is now in calc_bvec
JFLemieux73 Jul 9, 2018
fa0604b
removed Pr part from stress_vp calc
JFLemieux73 Jul 9, 2018
74c2b82
minor modifs to improve print of res norm in fgmres
JFLemieux73 Jul 11, 2018
ea595d8
added linear conv criterion based on a gamma
JFLemieux73 Jul 11, 2018
4f33964
added NL conv criterion
JFLemieux73 Jul 11, 2018
4ad3875
in the process of adding precond diag
JFLemieux73 Jul 12, 2018
422c724
now forms the vector diagvec
JFLemieux73 Jul 12, 2018
373d81a
precond diag is completed and compiles
JFLemieux73 Jul 12, 2018
7ea59d5
diagvec was not allocated...now ok
JFLemieux73 Jul 12, 2018
12af0f2
diagvec was not deallocated...now ok
JFLemieux73 Jul 12, 2018
4771f9c
fixed bug in formDiag_step2
JFLemieux73 Jul 12, 2018
0e1be0b
small modif
JFLemieux73 Jul 12, 2018
2dfa648
small modif...again
JFLemieux73 Jul 12, 2018
65eb209
modified formation of diagonal for precond
JFLemieux73 Jul 16, 2018
c0c94e4
just removed a comment
JFLemieux73 Jul 16, 2018
e5ddf7c
minor modif to formDiag_step1
JFLemieux73 Jul 16, 2018
c89ce45
added an option for precond (free drift diag or complete diag
JFLemieux73 Jul 16, 2018
9f75ad1
minor modif
JFLemieux73 Jul 16, 2018
3b01585
minor modif
JFLemieux73 Jul 16, 2018
4f601bc
removed OLDformDiag_step1
JFLemieux73 Jul 16, 2018
b1c4a8b
Ok I think I know what was wrong with the precond diag...I have to us…
JFLemieux73 Jul 18, 2018
adb70e7
precond 3 works but not as good as precond 2 (free drift)...removed O…
JFLemieux73 Jul 18, 2018
b16cd8a
ok found the problem in step2...now fixed
JFLemieux73 Jul 18, 2018
9a54b28
added routine to calc deformations for mech redistribution...for the …
JFLemieux73 Jul 18, 2018
14d4611
chnaged names of evp_prep1 to dyn_prep1...
JFLemieux73 Jul 18, 2018
5076124
in process of adding gmres as precond to fgmres...
JFLemieux73 Jul 19, 2018
71214b9
matvec is now done in one routine instead of in two steps before
JFLemieux73 Jul 20, 2018
da9a955
in the process of adding gmres precond
JFLemieux73 Jul 23, 2018
4b8a7c7
finalizing implementation of gmres for precond
JFLemieux73 Jul 23, 2018
76d30b7
pgmres seems to work...I used it as a solver and it works fine
JFLemieux73 Jul 23, 2018
f536a9b
minor modif: introduction of maxits_pgmres
JFLemieux73 Jul 23, 2018
441f849
modif to comments...very minor
JFLemieux73 Jul 25, 2018
21364ec
something was inconsistent for precond choice...now fixed and removed…
JFLemieux73 Jul 26, 2018
f57e346
removed krelax...not needed as a more complex method will be added
JFLemieux73 Aug 31, 2018
c547d30
in the process of adding the RRE1 acceleration method
JFLemieux73 Aug 31, 2018
67ae918
fixed problem in halo update (spherical grid...wraps on itself) befor…
JFLemieux73 Sep 5, 2018
b3bc476
cicecore: add puny_dyn variable to initialize tinyarea, remove tempor…
phil-blain Jan 22, 2019
3ddca0e
ice_dyn_vp: move solver algorithm and output parameters to namelist
phil-blain Jan 23, 2019
596ae1e
{f,}gmres: use nu_diag for output
phil-blain Jan 23, 2019
a6ae6e5
dynamics: correct 2 bugs found using debugging flags
phil-blain Jan 25, 2019
5a77775
ice_dyn_vp: rename VP namelist variables to be more descriptive
phil-blain Jan 28, 2019
84f2973
pgmres: streamlined monitoring output
phil-blain Jan 29, 2019
da38075
ice_dyn_vp: add computation of nonlinear and fixed point residuals
phil-blain Jan 29, 2019
df8ff72
ice_dyn_vp: remove references to RRE acceleration method
phil-blain Jan 29, 2019
aca44ed
ice_dyn_vp: remove unused 'ulin', 'vlin' variables
phil-blain Jan 29, 2019
945dada
ice_dyn_vp: move Picard iteration to separate subroutine
phil-blain Feb 7, 2019
e33986c
ice_dyn_vp: add Anderson acceleration for Picard iteration
phil-blain Feb 21, 2019
03a152e
options: add options files for implicit solver
phil-blain May 3, 2019
65c8012
ice_dyn_vp: correct residual computations if max_blocks > 1
phil-blain Mar 4, 2019
7d2c6d4
ice_dyn_vp: differentiate fixed point and progress residuals
phil-blain Mar 4, 2019
779cf43
ice_dyn_vp: fix convergence issues in Picard and Anderson solvers
phil-blain Mar 7, 2019
57e096f
ice_dyn_vp: add (ulin,vlin) to compute vrel based on 2 previous iterates
phil-blain Mar 14, 2019
4a96460
machines: cesium: add LAPACK and BLAS library to Macros
phil-blain Mar 15, 2019
836e546
ice_dyn_vp: add 'subname' variable to each subroutine
phil-blain Apr 29, 2019
7640444
ice_dyn_vp: cleanup 'icepack_warnings_*' calls
phil-blain Apr 29, 2019
148668c
ice_dyn_vp, pgmres: remove unused arguments, variables and 'use' stat…
phil-blain Apr 29, 2019
6eb86cd
ice_dyn_vp: refactor 'puny' treatment for implicit solver
phil-blain Jun 10, 2019
58fa7e8
ice_dyn_vp: make 'calc_bvec' use already computed 'vrel'
phil-blain Jun 10, 2019
b23a940
ice_dyn_vp: remove references to fgmres2 subroutine
phil-blain Jun 10, 2019
c9bf1c7
dynamics: remove 'BLAS_routines.F90'
phil-blain Jul 9, 2019
5848a50
ice_dyn_vp: synchronize 'imp_solver' with ice_dyn_evp::evp
phil-blain Jul 9, 2019
e0f4c5d
dynamics: refactor strain rates and deformation calculations
phil-blain Jul 10, 2019
c41d1e8
dynamics: add sol_fgmres2d from GEM as ice_krylov.F90 (does not compile)
phil-blain Jul 15, 2019
8319355
ice_krylov: adapt FGMRES algo up to inner loop (WIP)
phil-blain Jul 19, 2019
b7460a2
ice_krylov: adapt FGMRES algo up to preconditioner call (WIP)
phil-blain Jul 19, 2019
a8e4ed2
ice_krylov: adapt FGMRES algo up to before CGS (WIP)
phil-blain Jul 19, 2019
a1d6d77
ice_krylov: adapt FGMRES algo up to end of Arnoldi (except 1st GS loo…
phil-blain Jul 19, 2019
34a602f
ice_krylov: adapt FGMRES algo up to updating of solution (WIP)
phil-blain Jul 19, 2019
5925c94
ice_krylov: adapt FGMRES algo up to residual calculation (WIP)
phil-blain Jul 19, 2019
b6fa842
ice_krylov: correct CICE kinds in function almost_zero
phil-blain Jul 22, 2019
af5adaa
comm: add 'global_sums' module procedure
phil-blain Jul 13, 2020
0e79c53
ice_krylov: adapt FGMRES including Gram-Schmidt (WIP)
phil-blain Jul 22, 2019
c5c3ab1
ice_krylov: add 'pgmres' subroutine (mostly the same as 'fgmres')
phil-blain Jul 22, 2019
be63b45
ice_krylov: move subroutines to ice_dyn_vp to work around circular deps
phil-blain Jul 23, 2019
17a290e
ice_dyn_vp: add 'subname' to subroutine 'almost_zero' and correct ind…
phil-blain Jul 24, 2019
9fd638d
ice_dyn_vp: add 'ice_HaloUpdate_vel' subroutine
phil-blain Jul 24, 2019
865a716
ice_dyn_vp: make 'fld2' a module variable
phil-blain Jul 24, 2019
93c0335
ice_dyn_vp: move 'ice_halo' to module 'use' statement
phil-blain Jul 24, 2019
282edf9
ice_dyn_vp: add workspace initialization to 0 and haloupdate before m…
phil-blain Jul 24, 2019
aaf9a89
ice_dyn_vp: add choice between classical and modified Gram-Schmidt or…
phil-blain Nov 4, 2019
79749ad
ice_dyn_vp: change order of arguments for 'precondition' subroutine
phil-blain Nov 5, 2019
b6769e9
ice_dyn_vp: fgmres: correctly initialize workspace_[xy] and arnoldi_b…
phil-blain Nov 5, 2019
9e0a27a
ice_dyn_vp: matvec: change Au,Av from 'intent(out)' to 'intent(inout)'
phil-blain Nov 5, 2019
1e35c9a
ice_dyn_vp: clarify decriptions of FGMRES variables
phil-blain Nov 7, 2019
07c2b01
ice_dyn_vp: add subroutines description and clarify existing ones
phil-blain Nov 8, 2019
d1e9804
ice_dyn_vp: fix comments in FGMRES algorithm
phil-blain Nov 8, 2019
867318a
ice_dyn_vp: fgmres: fix misleading check for return
phil-blain Nov 8, 2019
10fc1ea
ice_dyn_vp: fgmres: fix error in the last loop computing the residual
phil-blain Nov 8, 2019
9c8667f
ice_dyn_vp: change the definition of F(x) from 'A.x - b' to 'b - A.x'
phil-blain Nov 8, 2019
829f2c4
ice_dyn_vp: fgmres: comment out early return (WIP)
phil-blain Nov 13, 2019
3ddc81c
ice_dyn_vp: pgmres: synchronize with fgmres (WIP)
phil-blain Nov 13, 2019
fc4fa1c
ice_dyn_vp: picard_solver: re-enable legacy solver
phil-blain Nov 26, 2019
71b463c
cicecore: remove remaining 'SVN:$Id:' lines
phil-blain Feb 11, 2020
9877fd7
ice_dyn_vp: remove 'picard_solver' subroutine
phil-blain Feb 12, 2020
d67e722
ice_dyn_vp: remove legacy FGMRES solver
phil-blain Feb 17, 2020
829d6ed
ice_dyn_vp: pgmres: use Classical Gram-Schmidt
phil-blain Mar 2, 2020
5eaf2e6
ice_in: change maxits_{f,p}gmres to be in line with new meaning
phil-blain Mar 2, 2020
668cad8
ice_dyn_vp: uniformize naming of namelist parameters for solver toler…
phil-blain Mar 3, 2020
4e55a33
ice_dyn_vp: anderson_solver: adapt residual norm computations for MPI
phil-blain Mar 3, 2020
7608081
ice_dyn_vp: write solver diagnostics only for master task
phil-blain Mar 3, 2020
c45658c
ice_dyn_vp: remove references to EVP
phil-blain Mar 6, 2020
f233baf
ice_dyn_vp: rename 'puny_vp' to 'min_strain_rate'
phil-blain Mar 6, 2020
2baf569
ice_dyn_vp: remove "signature" comments from JF
phil-blain Mar 16, 2020
5ed406d
ice_dyn_vp: write stresses at end of time step
phil-blain Apr 14, 2020
ca7c4d2
ice_dyn_vp: cleanup 'intent's
phil-blain Apr 16, 2020
97fb097
dynamics: correct the definition of 'shearing strain rate' in comments
phil-blain Apr 17, 2020
22eb6a1
ice_dyn_vp: correctly use 'subname' in 'abort_ice' calls
phil-blain May 14, 2020
e0b0818
ice_dyn_vp: add 'calc_seabed_stress' subroutine
phil-blain May 14, 2020
1325775
dynamics: move basal stress residual velocity ('u0') to ice_dyn_shared
phil-blain May 14, 2020
945d87a
ice_dyn_vp: use 'deformations' from ice_dyn_shared
phil-blain May 15, 2020
de46782
ice_dyn_vp: simplify 'calc_vrel_Cb' subroutine
phil-blain May 15, 2020
189703a
ice_dyn_vp: rename 'Diag[uv]' to 'diag[xy]' for consistency
phil-blain May 15, 2020
62ac6a4
ice_dyn_vp: introduce 'CICE_USE_LAPACK' preprocessor macro
phil-blain May 15, 2020
6057ada
ice_dyn_vp: convert 'algo_nonlin' to string
phil-blain May 25, 2020
9b5613a
ice_dyn_vp: convert 'precond' to string
phil-blain May 25, 2020
811ba5a
ice_dyn_vp: convert 'monitor_{f,p}gmres' to logical
phil-blain May 25, 2020
bf6a015
ice_dyn_vp: remove unimplemented 'fpfunc_andacc' from the namelist
phil-blain May 25, 2020
d99912a
ice_dyn_vp: add input validation for string namelist variables
phil-blain May 25, 2020
63bdac1
ice_dyn_vp: abort if Anderson solver is used in parallel
phil-blain May 29, 2020
2381625
ice_dyn_vp: reimplement monitor_{f,p}gmres
phil-blain Jun 1, 2020
c23bf69
ice_dyn_vp: use 'ice_HaloUpdate_vel' everywhere
phil-blain Jun 1, 2020
64d7bcc
ice_dyn_vp: move ice_HaloUpdate_vel subroutine to ice_dyn_shared
phil-blain Jun 1, 2020
e85bca8
ice_dyn_evp: use ice_HaloUpdate_vel
phil-blain Jun 1, 2020
becf7e5
ice_dyn_eap: use ice_HaloUpdate_vel
phil-blain Jun 1, 2020
dc4174c
options: set 'use_mean_vrel' in 'dynpicard'
phil-blain Jun 2, 2020
c6e377b
conda: add 'libapack' to environment spec and Macros
phil-blain Jun 2, 2020
2b5b45a
ice_dyn_vp: initialize 'L2norm' and 'norm_squared' to zero
phil-blain Jun 12, 2020
a8e420b
ice_dyn_vp: initialize 'stPr' and 'zetaD' to zero
phil-blain Jun 25, 2020
0986749
doc: document implicit solver
phil-blain Jul 7, 2020
37deff5
ice_dyn_vp: default 'use_mean_vrel' to 'true'
phil-blain Jul 14, 2020
6029908
ice_in: remove Anderson solver parameters
phil-blain Jul 14, 2020
845e15a
ice_dyn_vp: add article references
phil-blain Jul 15, 2020
acc0627
ice_dyn_vp: remove unused subroutines
phil-blain Jul 15, 2020
c065dea
ice_dyn_vp: remove unused local variables
phil-blain Jul 15, 2020
5e946a4
ice_dyn_vp: calc_bvec: remove unused arguments
phil-blain Jul 15, 2020
9cfa74b
ice_dyn_vp: anderson_solver: remove unused arguments
phil-blain Jul 15, 2020
809fb36
ice_dyn_vp: remove unused 'use'-imported variables in subroutines
phil-blain Jul 15, 2020
b060c37
ice_dyn_vp: fix trailing whitespace errors
phil-blain Jul 16, 2020
0c3677f
ice_dyn_vp: uniformize indentation and whitespace
phil-blain Jul 16, 2020
ba6eb00
ice_dyn_vp: put 'intent's on same lines as types
phil-blain Jul 16, 2020
12e97b2
ice_dyn_vp: use '==' instead of '.eq.'
phil-blain Jul 16, 2020
2dfe55d
ice_dyn_vp: uniformize whitespace in subroutine arguments
phil-blain Jul 16, 2020
7355c58
ice_dyn_vp: calc_bvec: remove unneeded arguments
phil-blain Jul 16, 2020
210bf62
ice_dyn_vp: clean up and clarify code comments
phil-blain Jul 16, 2020
5edf0fd
ice_dyn_vp: matvec: remove unneeded local variable
phil-blain Jul 16, 2020
892040a
ice_dyn_vp: rename 'stPrtmp' to 'stress_Pr' and 'Dstrtmp' to 'diag_rheo'
phil-blain Jul 16, 2020
88db326
ice_dyn_vp: rename 'calc_zeta_Pr' to 'calc_zeta_dPr'
phil-blain Jul 17, 2020
235133d
ice_dyn_vp: rename 'ww[xy]' to 'orig_basis_[xy]'
phil-blain Jul 17, 2020
0d4e4c3
ice_dyn_vp: [fp]gmres: removed unused 'r0' variable and 'conv' argument
phil-blain Jul 17, 2020
ea840c7
ice_dyn_vp: make 'maxits_nonlin' default to 4
phil-blain Jul 20, 2020
294fe1d
ice_dyn_vp: rename 'im_{fgmres,pgmres,andacc}' to 'dim_*'
phil-blain Jul 20, 2020
bda247b
tests: add 'dynpicard' test to base_suite
phil-blain Jul 20, 2020
6d59f65
dynamics: remove proprietary vector directives
phil-blain Jul 20, 2020
13b3045
ice_init: validate implicit solver arguments only if solver is active
phil-blain Jul 21, 2020
3c2c5c7
ice_dyn_vp: rename 'imp_solver' to 'implicit_solver'
phil-blain Jul 21, 2020
ab21aad
doc: add caveat for VP solver (tx1 grid, threading)
phil-blain Jul 23, 2020
9978267
ice_dyn_vp: rename 'CICE_USE_LAPACK' macro to 'USE_LAPACK'
phil-blain Aug 11, 2020
2ef7e31
comm: rename 'global_sums' to 'global_allreduce_sum'
phil-blain Aug 14, 2020
3ba4a2e
dynamics: remove 'ice_HaloUpdate_vel' and introduce '(un)stack_veloci…
phil-blain Aug 24, 2020
e96bdda
dynamics: rename 'init_evp' to 'init_dyn'
phil-blain Aug 26, 2020
2fb99d1
drivers: call 'init_dyn' unconditionnally
phil-blain Aug 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 20 additions & 38 deletions cicecore/cicedynB/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ subroutine eap (dt)
use ice_dyn_shared, only: fcor_blk, ndte, dtei, &
denom1, uvel_init, vvel_init, arlx1i, &
dyn_prep1, dyn_prep2, stepu, dyn_finish, &
basal_stress_coeff, basalstress
basal_stress_coeff, basalstress, &
stack_velocity_field, unstack_velocity_field
use ice_flux, only: rdg_conv, strairxT, strairyT, &
strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, taubx, tauby, &
Expand Down Expand Up @@ -354,11 +355,6 @@ subroutine eap (dt)
vicen = vicen (i,j,:,iblk), &
strength = strength(i,j, iblk) )
enddo ! ij

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
fld2(:,:,2,iblk) = vvel(:,:,iblk)

enddo ! iblk
!$TCXOMP END PARALLEL DO

Expand All @@ -369,19 +365,8 @@ subroutine eap (dt)
call ice_timer_start(timer_bound)
call ice_HaloUpdate (strength, halo_info, &
field_loc_center, field_type_scalar)
! velocities may have changed in dyn_prep2
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
call ice_timer_stop(timer_bound)

! unload
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
uvel(:,:,iblk) = fld2(:,:,1,iblk)
vvel(:,:,iblk) = fld2(:,:,2,iblk)
enddo
!$OMP END PARALLEL DO

if (maskhalo_dyn) then
call ice_timer_start(timer_bound)
halomask = 0
Expand All @@ -392,6 +377,19 @@ subroutine eap (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)

!-----------------------------------------------------------------
! basal stress coefficients (landfast ice)
!-----------------------------------------------------------------
Expand Down Expand Up @@ -472,10 +470,6 @@ subroutine eap (dt)
uvel (:,:,iblk), vvel (:,:,iblk), &
Tbu (:,:,iblk))

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
fld2(:,:,2,iblk) = vvel(:,:,iblk)

!-----------------------------------------------------------------
! evolution of structure tensor A
!-----------------------------------------------------------------
Expand All @@ -501,6 +495,7 @@ subroutine eap (dt)
enddo
!$TCXOMP END PARALLEL DO

call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
Expand All @@ -510,14 +505,7 @@ subroutine eap (dt)
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)

! unload
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
uvel(:,:,iblk) = fld2(:,:,1,iblk)
vvel(:,:,iblk) = fld2(:,:,2,iblk)
enddo
!$OMP END PARALLEL DO
call unstack_velocity_field(fld2, uvel, vvel)

enddo ! subcycling

Expand Down Expand Up @@ -556,16 +544,12 @@ end subroutine eap
!=======================================================================

! Initialize parameters and variables needed for the eap dynamics
! (based on init_evp)
! (based on init_dyn)

subroutine init_eap (dt)
subroutine init_eap

use ice_blocks, only: nx_block, ny_block
use ice_domain, only: nblocks
use ice_dyn_shared, only: init_evp

real (kind=dbl_kind), intent(in) :: &
dt ! time step

! local variables

Expand Down Expand Up @@ -595,8 +579,6 @@ subroutine init_eap (dt)
file=__FILE__, line=__LINE__)
phi = pi/c12 ! diamond shaped floe smaller angle (default phi = 30 deg)

call init_evp (dt)

!$OMP PARALLEL DO PRIVATE(iblk,i,j)
do iblk = 1, nblocks
do j = 1, ny_block
Expand Down Expand Up @@ -1321,7 +1303,7 @@ subroutine stress_eap (nx_block, ny_block, &
tensionse = -cym(i,j)*uvel(i ,j-1) - dyt(i,j)*uvel(i-1,j-1) &
+ cxp(i,j)*vvel(i ,j-1) - dxt(i,j)*vvel(i ,j )

! shearing strain rate = e_12
! shearing strain rate = 2*e_12
shearne = -cym(i,j)*vvel(i ,j ) - dyt(i,j)*vvel(i-1,j ) &
- cxm(i,j)*uvel(i ,j ) - dxt(i,j)*uvel(i ,j-1)
shearnw = -cyp(i,j)*vvel(i-1,j ) + dyt(i,j)*vvel(i ,j ) &
Expand Down
129 changes: 49 additions & 80 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ subroutine evp (dt)
ice_timer_start, ice_timer_stop, timer_evp_1d, timer_evp_2d
use ice_dyn_evp_1d, only: ice_dyn_evp_1d_copyin, ice_dyn_evp_1d_kernel, &
ice_dyn_evp_1d_copyout
use ice_dyn_shared, only: kevp_kernel
use ice_dyn_shared, only: kevp_kernel, stack_velocity_field, unstack_velocity_field

real (kind=dbl_kind), intent(in) :: &
dt ! time step
Expand Down Expand Up @@ -297,10 +297,6 @@ subroutine evp (dt)
strength = strength(i,j, iblk) )
enddo ! ij

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
fld2(:,:,2,iblk) = vvel(:,:,iblk)

enddo ! iblk
!$TCXOMP END PARALLEL DO

Expand All @@ -311,19 +307,8 @@ subroutine evp (dt)
call ice_timer_start(timer_bound)
call ice_HaloUpdate (strength, halo_info, &
field_loc_center, field_type_scalar)
! velocities may have changed in dyn_prep2
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
call ice_timer_stop(timer_bound)

! unload
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
uvel(:,:,iblk) = fld2(:,:,1,iblk)
vvel(:,:,iblk) = fld2(:,:,2,iblk)
enddo
!$OMP END PARALLEL DO

if (maskhalo_dyn) then
call ice_timer_start(timer_bound)
halomask = 0
Expand All @@ -334,6 +319,19 @@ subroutine evp (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)

!-----------------------------------------------------------------
! basal stress coefficients (landfast ice)
!-----------------------------------------------------------------
Expand Down Expand Up @@ -442,13 +440,10 @@ subroutine evp (dt)
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk), &
Tbu (:,:,iblk))

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
fld2(:,:,2,iblk) = vvel(:,:,iblk)
enddo
!$TCXOMP END PARALLEL DO

call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
Expand All @@ -458,14 +453,7 @@ subroutine evp (dt)
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)

! unload
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
uvel(:,:,iblk) = fld2(:,:,1,iblk)
vvel(:,:,iblk) = fld2(:,:,2,iblk)
enddo
!$OMP END PARALLEL DO
call unstack_velocity_field(fld2, uvel, vvel)

enddo ! subcycling
endif ! kevp_kernel
Expand Down Expand Up @@ -599,6 +587,8 @@ subroutine stress (nx_block, ny_block, &
rdg_conv, rdg_shear, &
str )

use ice_dyn_shared, only: strain_rates, deformations

integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
ksub , & ! subcycling step
Expand Down Expand Up @@ -676,58 +666,20 @@ subroutine stress (nx_block, ny_block, &
! strain rates
! NOTE these are actually strain rates * area (m^2/s)
!-----------------------------------------------------------------
! divergence = e_11 + e_22
divune = cyp(i,j)*uvel(i ,j ) - dyt(i,j)*uvel(i-1,j ) &
+ cxp(i,j)*vvel(i ,j ) - dxt(i,j)*vvel(i ,j-1)
divunw = cym(i,j)*uvel(i-1,j ) + dyt(i,j)*uvel(i ,j ) &
+ cxp(i,j)*vvel(i-1,j ) - dxt(i,j)*vvel(i-1,j-1)
divusw = cym(i,j)*uvel(i-1,j-1) + dyt(i,j)*uvel(i ,j-1) &
+ cxm(i,j)*vvel(i-1,j-1) + dxt(i,j)*vvel(i-1,j )
divuse = cyp(i,j)*uvel(i ,j-1) - dyt(i,j)*uvel(i-1,j-1) &
+ cxm(i,j)*vvel(i ,j-1) + dxt(i,j)*vvel(i ,j )

! tension strain rate = e_11 - e_22
tensionne = -cym(i,j)*uvel(i ,j ) - dyt(i,j)*uvel(i-1,j ) &
+ cxm(i,j)*vvel(i ,j ) + dxt(i,j)*vvel(i ,j-1)
tensionnw = -cyp(i,j)*uvel(i-1,j ) + dyt(i,j)*uvel(i ,j ) &
+ cxm(i,j)*vvel(i-1,j ) + dxt(i,j)*vvel(i-1,j-1)
tensionsw = -cyp(i,j)*uvel(i-1,j-1) + dyt(i,j)*uvel(i ,j-1) &
+ cxp(i,j)*vvel(i-1,j-1) - dxt(i,j)*vvel(i-1,j )
tensionse = -cym(i,j)*uvel(i ,j-1) - dyt(i,j)*uvel(i-1,j-1) &
+ cxp(i,j)*vvel(i ,j-1) - dxt(i,j)*vvel(i ,j )

! shearing strain rate = e_12
shearne = -cym(i,j)*vvel(i ,j ) - dyt(i,j)*vvel(i-1,j ) &
- cxm(i,j)*uvel(i ,j ) - dxt(i,j)*uvel(i ,j-1)
shearnw = -cyp(i,j)*vvel(i-1,j ) + dyt(i,j)*vvel(i ,j ) &
- cxm(i,j)*uvel(i-1,j ) - dxt(i,j)*uvel(i-1,j-1)
shearsw = -cyp(i,j)*vvel(i-1,j-1) + dyt(i,j)*vvel(i ,j-1) &
- cxp(i,j)*uvel(i-1,j-1) + dxt(i,j)*uvel(i-1,j )
shearse = -cym(i,j)*vvel(i ,j-1) - dyt(i,j)*vvel(i-1,j-1) &
- cxp(i,j)*uvel(i ,j-1) + dxt(i,j)*uvel(i ,j )

! Delta (in the denominator of zeta, eta)
Deltane = sqrt(divune**2 + ecci*(tensionne**2 + shearne**2))
Deltanw = sqrt(divunw**2 + ecci*(tensionnw**2 + shearnw**2))
Deltasw = sqrt(divusw**2 + ecci*(tensionsw**2 + shearsw**2))
Deltase = sqrt(divuse**2 + ecci*(tensionse**2 + shearse**2))

!-----------------------------------------------------------------
! on last subcycle, save quantities for mechanical redistribution
!-----------------------------------------------------------------
if (ksub == ndte) then
divu(i,j) = p25*(divune + divunw + divuse + divusw) * tarear(i,j)
tmp = p25*(Deltane + Deltanw + Deltase + Deltasw) * tarear(i,j)
rdg_conv(i,j) = -min(divu(i,j),c0)
rdg_shear(i,j) = p5*(tmp-abs(divu(i,j)))

! diagnostic only
! shear = sqrt(tension**2 + shearing**2)
shear(i,j) = p25*tarear(i,j)*sqrt( &
(tensionne + tensionnw + tensionse + tensionsw)**2 &
+ (shearne + shearnw + shearse + shearsw)**2)

endif
call strain_rates (nx_block, ny_block, &
i, j, &
uvel, vvel, &
dxt, dyt, &
cxp, cyp, &
cxm, cym, &
divune, divunw, &
divuse, divusw, &
tensionne, tensionnw, &
tensionse, tensionsw, &
shearne, shearnw, &
shearse, shearsw, &
Deltane, Deltanw, &
Deltase, Deltasw )

!-----------------------------------------------------------------
! strength/Delta ! kg/s
Expand Down Expand Up @@ -902,6 +854,23 @@ subroutine stress (nx_block, ny_block, &

enddo ! ij

!-----------------------------------------------------------------
! on last subcycle, save quantities for mechanical redistribution
!-----------------------------------------------------------------
if (ksub == ndte) then
call deformations (nx_block , ny_block , &
icellt , &
indxti , indxtj , &
uvel , vvel , &
dxt , dyt , &
cxp , cyp , &
cxm , cym , &
tarear , &
shear , divu , &
rdg_conv , rdg_shear )

endif

end subroutine stress

!=======================================================================
Expand Down
4 changes: 2 additions & 2 deletions cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ subroutine stress_i(NA_len, &
! tension strain rate = e_11 - e_22
tensionne = -cym*uvel(iw) - dyt(iw)*tmp_uvel_ee &
+ cxm*vvel(iw) + dxt(iw)*tmp_vvel_se
! shearing strain rate = e_12
! shearing strain rate = 2*e_12
shearne = -cym*vvel(iw) - dyt(iw)*tmp_vvel_ee &
- cxm*uvel(iw) - dxt(iw)*tmp_uvel_se
! Delta (in the denominator of zeta, eta)
Expand Down Expand Up @@ -614,7 +614,7 @@ subroutine stress_l(NA_len, tarear, &
tensionse = -cym*tmp_uvel_se - dyt(iw)*tmp_uvel_ne &
+ cxp*tmp_vvel_se - dxt(iw)*vvel(iw)

! shearing strain rate = e_12
! shearing strain rate = 2*e_12
shearne = -cym*vvel(iw) - dyt(iw)*tmp_vvel_ee &
- cxm*uvel(iw) - dxt(iw)*tmp_uvel_se
shearnw = -cyp*tmp_vvel_ee + dyt(iw)*vvel(iw) &
Expand Down
Loading