- Timestamp:
- 2017-09-27T12:09:10+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icethd_ent.F90
r8562 r8565 78 78 ! 1) Cumulative integral of old enthalpy * thickness and layers interfaces 79 79 !-------------------------------------------------------------------------- 80 zeh_cum0(1:n idx,0) = 0._wp81 zh_cum0 (1:n idx,0) = 0._wp80 zeh_cum0(1:npti,0) = 0._wp 81 zh_cum0 (1:npti,0) = 0._wp 82 82 DO jk0 = 1, nlay_i+2 83 DO ji = 1, n idx83 DO ji = 1, npti 84 84 zeh_cum0(ji,jk0) = zeh_cum0(ji,jk0-1) + eh_i_old(ji,jk0-1) 85 85 zh_cum0 (ji,jk0) = zh_cum0 (ji,jk0-1) + h_i_old (ji,jk0-1) … … 91 91 !------------------------------------ 92 92 ! new layer thickesses 93 DO ji = 1, n idx93 DO ji = 1, npti 94 94 zhnew(ji) = SUM( h_i_old(ji,0:nlay_i+1) ) * r1_nlay_i 95 95 END DO 96 96 97 97 ! new layers interfaces 98 zh_cum1(1:n idx,0) = 0._wp98 zh_cum1(1:npti,0) = 0._wp 99 99 DO jk1 = 1, nlay_i 100 DO ji = 1, n idx100 DO ji = 1, npti 101 101 zh_cum1(ji,jk1) = zh_cum1(ji,jk1-1) + zhnew(ji) 102 102 END DO 103 103 END DO 104 104 105 zeh_cum1(1:n idx,0) = 0._wp105 zeh_cum1(1:npti,0) = 0._wp 106 106 ! new cumulative q*h => linear interpolation 107 107 DO jk0 = 1, nlay_i+1 108 108 DO jk1 = 1, nlay_i-1 109 DO ji = 1, n idx109 DO ji = 1, npti 110 110 IF( zh_cum1(ji,jk1) <= zh_cum0(ji,jk0) .AND. zh_cum1(ji,jk1) > zh_cum0(ji,jk0-1) ) THEN 111 111 zeh_cum1(ji,jk1) = ( zeh_cum0(ji,jk0-1) * ( zh_cum0(ji,jk0) - zh_cum1(ji,jk1 ) ) + & … … 117 117 END DO 118 118 ! to ensure that total heat content is strictly conserved, set: 119 zeh_cum1(1:n idx,nlay_i) = zeh_cum0(1:nidx,nlay_i+2)119 zeh_cum1(1:npti,nlay_i) = zeh_cum0(1:npti,nlay_i+2) 120 120 121 121 ! new enthalpies 122 122 DO jk1 = 1, nlay_i 123 DO ji = 1, n idx123 DO ji = 1, npti 124 124 rswitch = MAX( 0._wp , SIGN( 1._wp , zhnew(ji) - epsi20 ) ) 125 125 qnew(ji,jk1) = rswitch * ( zeh_cum1(ji,jk1) - zeh_cum1(ji,jk1-1) ) / MAX( zhnew(ji), epsi20 ) … … 130 130 ! comment: if input h_i_old and eh_i_old are already multiplied by a_i (as in icethd_do), 131 131 ! then we should not (* a_i) again but not important since this is just to check that remap error is ~0 132 DO ji = 1, n idx132 DO ji = 1, npti 133 133 hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + a_i_1d(ji) * r1_rdtice * & 134 134 & ( SUM( qnew(ji,1:nlay_i) ) * zhnew(ji) - SUM( eh_i_old(ji,0:nlay_i+1) ) )
Note: See TracChangeset
for help on using the changeset viewer.