Skip to content

Commit

Permalink
update kind conversions in ice_dyn_evp_1d.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
apcraig committed Aug 28, 2019
1 parent e6fd180 commit c202239
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ subroutine domp_get_domain_rlu(lower,upper,d_lower,d_upper)
#if defined (_OPENMP)
if (omp_in_parallel()) then
dlen = real(upper-lower+1, dbl_kind)
d_lower = lower + floor((rdomp_iam*dlen+p5)/rdomp_nt, 4)
d_upper = lower -1 + floor((rdomp_iam*dlen+dlen+p5)/rdomp_nt, 4)
d_lower = lower + floor((rdomp_iam*dlen+p5)/rdomp_nt, JPIM)
d_upper = lower -1 + floor((rdomp_iam*dlen+dlen+p5)/rdomp_nt, JPIM)
endif
#endif

Expand Down Expand Up @@ -843,7 +843,7 @@ subroutine stepu_last(NA_len, rhow, &
real(kind=dbl_kind),dimension(:), intent(in), contiguous :: &
uvel_init, vvel_init, aiu, forcex, forcey, umassdti, Tbu, &
uocn, vocn, fm, uarear,Cw
real(kind=dbl_kind),dimension(:), intent(in), contiguous :: &
real(kind=DBL_KIND),dimension(:), intent(in), contiguous :: &
str1,str2,str3,str4,str5,str6,str7,str8
real(kind=dbl_kind),dimension(:), intent(inout), contiguous :: &
uvel,vvel, strintx,strinty, taubx,tauby
Expand Down Expand Up @@ -1003,7 +1003,7 @@ module ice_dyn_evp_1d
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1,stress12_2,stress12_3,stress12_4, &
divu,rdg_conv,rdg_shear,shear,taubx,tauby
real (kind=dbl_kind), dimension(:), allocatable :: &
real (kind=DBL_KIND), dimension(:), allocatable :: &
str1, str2, str3, str4, str5, str6, str7, str8
real (kind=dbl_kind), dimension(:), allocatable :: &
HTE,HTN, &
Expand Down

1 comment on commit c202239

@mhrib
Copy link
Contributor

@mhrib mhrib commented on c202239 Aug 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tony,
I am not confident, that you it is safe to change the "non-capital" dbl_kind to capital ones.

The capital "DBL_KIND" is a "poor-mans" way to easily obtain an equal code, but using internally SINGLE precession instead of the default DOUBLE precession. This can be done using a simple sed-command to the file. This version only require approx half memory usage, and it is also faster. But the code is not BFB equal anymore wrt. the original code.
However, you can not change ALL variables to singles without loosing too much presission - defined as the "noise level" that stems from a change of compiler (intel->gnu->cray->nag) and/or computer using the SAME code in DOUBLE precession allover. Some variables have to stay DOUBLE, which are the input/output ones within the stress/stepu iterations. Which are the str1..8 + uvel+vvel as I recall...

Jacob Weismann and I tested it, but did not have time for implement it to the CICE code without just almost duplicating the code, which makes future maintenance much more demanding.

--o--

The changes in the floor precession/kind argument seems to be fine.

rgs
Mads

Please sign in to comment.