Changeset 9482
- Timestamp:
- 2018-04-13T19:03:31+02:00 (7 years ago)
- Location:
- branches/2017/dev_merge_2017/NEMOGCM/NEMO
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icedyn_rhg_evp.F90
r9169 r9482 176 176 177 177 IF( kt == nit000 .AND. lwp ) WRITE(numout,*) '-- ice_dyn_rhg_evp: EVP sea-ice rheology' 178 179 #if defined key_agrif180 CALL agrif_interp_lim3( 'U', 0, nn_nevp ) ! First interpolation of coarse values181 CALL agrif_interp_lim3( 'V', 0, nn_nevp )182 #endif183 178 ! 184 179 !!gm for Clem: OPTIMIZATION: I think zfmask can be computed one for all at the initialization.... -
branches/2017/dev_merge_2017/NEMOGCM/NEMO/LIM_SRC_3/icestp.F90
r9448 r9482 110 110 kt_ice = kt ! -- Ice model time step 111 111 ! 112 # if defined key_agrif113 IF( .NOT. Agrif_Root() ) lim_nbstep = MOD( lim_nbstep, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1114 # endif115 112 u_oce(:,:) = ssu_m(:,:) ! -- mean surface ocean current 116 113 v_oce(:,:) = ssv_m(:,:) … … 119 116 t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) ) 120 117 ! 121 CALL store_fields ! -- Store now ice values 118 ! !== AGRIF Parent to Child ==! 119 #if defined key_agrif 120 ! ! lim_nbstep ranges from 1 to the nb of child ocean steps inside one parent ice step 121 IF( .NOT. Agrif_Root() ) lim_nbstep = MOD( lim_nbstep, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1 122 ! ! these calls must remain here for restartability purposes 123 CALL agrif_interp_lim3( 'T' ) 124 CALL agrif_interp_lim3( 'U' ) 125 CALL agrif_interp_lim3( 'V' ) 126 #endif 127 CALL store_fields ! Store now ice values 122 128 ! 123 129 !------------------------------------------------! … … 131 137 ! --- ice dynamics and advection --- ! 132 138 !-------------------------------------! 133 CALL diag_set0! set diag of mass, heat and salt fluxes to 0134 CALL ice_rst_opn( kt )! Open Ice restart file (if necessary)139 CALL diag_set0 ! set diag of mass, heat and salt fluxes to 0 140 CALL ice_rst_opn( kt ) ! Open Ice restart file (if necessary) 135 141 ! 136 142 IF( ln_icedyn .AND. .NOT.lk_c1d ) & … … 138 144 ! 139 145 ! !== lateral boundary conditions ==! 140 #if defined key_agrif141 IF( .NOT. Agrif_Root() ) CALL agrif_interp_lim3('T') ! -- AGRIF142 #endif143 146 IF( ln_icethd .AND. ln_bdy ) CALL bdy_ice( kt ) ! -- bdy ice thermo 144 147 ! 145 !146 148 ! !== previous lead fraction and ice volume for flux calculations 147 CALL ice_var_glo2eqv! h_i and h_s for ice albedo calculation148 CALL ice_var_agg(1)! at_i for coupling149 CALL store_fields! Store now ice values150 149 CALL ice_var_glo2eqv ! h_i and h_s for ice albedo calculation 150 CALL ice_var_agg(1) ! at_i for coupling 151 CALL store_fields ! Store now ice values 152 ! 151 153 !------------------------------------------------------! 152 154 ! --- Thermodynamical coupling with the atmosphere --- ! … … 170 172 ! 171 173 IF( ln_icethd ) CALL ice_cor( kt , 2 ) ! -- Corrections 174 ! 175 ! !== AGRIF Child to Parent ==! 172 176 # if defined key_agrif 173 IF( .NOT. Agrif_Root() )CALL agrif_update_lim3( kt )177 CALL agrif_update_lim3( kt ) 174 178 # endif 175 CALL ice_var_glo2eqv! necessary calls (at least for coupling)176 CALL ice_var_agg( 2 )! necessary calls (at least for coupling)177 179 CALL ice_var_glo2eqv ! necessary calls (at least for coupling) 180 CALL ice_var_agg( 2 ) ! necessary calls (at least for coupling) 181 ! 178 182 !! clem: one should switch the calculation of the fluxes onto the parent grid but the following calls do not work 179 183 !! moreover it should only be called at the update frequency (as in agrif_lim3_update.F90) 180 ! !# if defined key_agrif181 ! !IF( .NOT. Agrif_Root() ) CALL Agrif_ChildGrid_To_ParentGrid()182 ! !# endif184 !# if defined key_agrif 185 ! IF( .NOT. Agrif_Root() ) CALL Agrif_ChildGrid_To_ParentGrid() 186 !# endif 183 187 CALL ice_update_flx( kt ) ! -- Update ocean surface mass, heat and salt fluxes 184 ! !# if defined key_agrif185 ! !IF( .NOT. Agrif_Root() ) CALL Agrif_ParentGrid_To_ChildGrid()186 ! !# endif188 !# if defined key_agrif 189 ! IF( .NOT. Agrif_Root() ) CALL Agrif_ParentGrid_To_ChildGrid() 190 !# endif 187 191 IF( ln_icediahsb ) CALL ice_dia( kt ) ! -- Diagnostics outputs 188 192 ! -
branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC/agrif_lim3_interp.F90
r9454 r9482 53 53 !!----------------------------------------------------------------------- 54 54 ! 55 IF( Agrif_Root() .OR. nn_ice==0 ) RETURN ! do not interpolate if inside Parent domainor if child domain does not have ice55 IF( Agrif_Root() .OR. nn_ice==0 ) RETURN ! do not interpolate if inside Parent Grid or if child domain does not have ice 56 56 ! 57 57 SELECT CASE( cd_type ) 58 58 CASE('U','V') 59 IF( PRESENT( kiter ) ) THEN ! interpolation at the child sub-time step (only for ice rheology)59 IF( PRESENT( kiter ) ) THEN ! interpolation at the child ice sub-time step (only for ice rheology) 60 60 zbeta = ( REAL(lim_nbstep) - REAL(kitermax - kiter) / REAL(kitermax) ) / & 61 61 & ( Agrif_Rhot() * REAL(Agrif_Parent(nn_fsbc)) / REAL(nn_fsbc) ) 62 ELSE ! interpolation at the child time step62 ELSE ! interpolation at the child ice time step 63 63 zbeta = REAL(lim_nbstep) / ( Agrif_Rhot() * REAL(Agrif_Parent(nn_fsbc)) / REAL(nn_fsbc) ) 64 64 ENDIF … … 204 204 ! 205 205 DO jk = 1, nlay_s 206 e_s(i1:i2,j1:j2,jk,jl) = ptab( :,:,jm) * tmask(i1:i2,j1:j2,1)206 e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 207 207 jm = jm + 1 208 208 END DO 209 209 ! 210 210 DO jk = 1, nlay_i 211 e_i(i1:i2,j1:j2,jk,jl) = ptab( :,:,jm) * tmask(i1:i2,j1:j2,1)211 e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 212 212 jm = jm + 1 213 213 END DO … … 216 216 ! 217 217 !!==> clem: this interpolation does not work because it creates negative values, due 218 ! 218 !! to negative coefficients when mixing points (for ex. z7) 219 219 !! 220 220 ! ELSE ! ==> complex interpolation (only one ghost cell available) 221 221 ! !! Use a more complex interpolation since we mix solutions over a couple of grid points 222 222 ! !! it is advised to use it for fields modified by high order schemes (e.g. advection UM5...) 223 ! !! clem: for some reason (I don't know why), the following lines do not work224 ! ! I think there is an issue with Agrif_SpecialValue here (not taken into account properly)225 223 ! ! record ztab 226 224 ! jm = 1 … … 358 356 ! ENDIF ! nbghostcells=1 359 357 360 ! integrated values361 vt_i (i1:i2,j1:j2) = SUM( v_i(i1:i2,j1:j2,:), dim=3 )362 vt_s (i1:i2,j1:j2) = SUM( v_s(i1:i2,j1:j2,:), dim=3 )363 at_i (i1:i2,j1:j2) = SUM( a_i(i1:i2,j1:j2,:), dim=3 )364 et_s(i1:i2,j1:j2) = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 )365 et_i(i1:i2,j1:j2) = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 )366 367 at_ip(i1:i2,j1:j2) = SUM( a_ip(i1:i2,j1:j2,:), dim=3 ) ! melt ponds368 vt_ip(i1:i2,j1:j2) = SUM( v_ip(i1:i2,j1:j2,:), dim=3 )369 !370 ato_i(i1:i2,j1:j2) = 1._wp - at_i(i1:i2,j1:j2) ! open water fraction371 372 358 DO jl = 1, jpl 373 359 WHERE( tmask(i1:i2,j1:j2,1) == 0._wp ) t_su(i1:i2,j1:j2,jl) = rt0 ! to avoid a division by 0 in sbcblk.F90 -
branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90
r9454 r9482 1 1 #define TWO_WAY 2 !!#undef TWO_WAY 2 3 3 4 MODULE agrif_lim3_update … … 32 33 PRIVATE 33 34 34 PUBLIC agrif_update_lim3 ! called by agrif_user.F90 35 PUBLIC agrif_update_lim3 ! called by agrif_user.F90 and icestp.F90 35 36 36 37 !!---------------------------------------------------------------------- … … 51 52 !!---------------------------------------------------------------------- 52 53 ! 53 !! clem: I think the update should take place each time the ocean sees the surface forcings 54 !! (but maybe I am wrong and we should update every rhot time steps) 55 IF( ( MOD( (kt-nit000)/nn_fsbc + 1, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) /=0 ) .AND. (kt /= 0) ) RETURN ! do not update if nb of child time steps differ from time refinement 56 ! i.e. update only at the parent time step 57 IF( nn_ice == 0 ) RETURN ! do not update if child domain does not have ice 54 IF( Agrif_Root() .OR. nn_ice == 0 ) RETURN ! do not update if inside Parent Grid or if child domain does not have ice 55 ! 56 IF( ( MOD( (kt-nit000)/nn_fsbc + 1, Agrif_irhot() * Agrif_Parent(nn_fsbc)/nn_fsbc ) /=0 ) .AND. (kt /= 0) ) RETURN ! update only at the parent ice time step 58 57 ! 59 58 Agrif_SpecialValueFineGrid = -9999. … … 148 147 END DO 149 148 ! 150 ! integrated values151 vt_i(i1:i2,j1:j2) = SUM( v_i(i1:i2,j1:j2,:) , dim=3 )152 vt_s(i1:i2,j1:j2) = SUM( v_s(i1:i2,j1:j2,:) , dim=3 )153 at_i(i1:i2,j1:j2) = SUM( a_i(i1:i2,j1:j2,:) , dim=3 )154 et_s(i1:i2,j1:j2) = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 )155 et_i(i1:i2,j1:j2) = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 )156 157 at_ip(i1:i2,j1:j2) = SUM( a_ip(i1:i2,j1:j2,:), dim=3 ) ! melt ponds158 vt_ip(i1:i2,j1:j2) = SUM( v_ip(i1:i2,j1:j2,:), dim=3 )159 !160 ato_i(i1:i2,j1:j2) = 1._wp - at_i(i1:i2,j1:j2) ! open water fraction161 162 149 DO jl = 1, jpl 163 150 WHERE( tmask(i1:i2,j1:j2,1) == 0._wp ) t_su(i1:i2,j1:j2,jl) = rt0 ! to avoid a division by 0 in sbcblk.F90 -
branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
r9449 r9482 307 307 USE agrif_top_update 308 308 #endif 309 #if defined key_lim3 310 USE agrif_lim3_update 311 #endif 309 312 ! 310 313 IMPLICIT NONE … … 323 326 !! CALL Agrif_Update_tke(0) 324 327 328 #if defined key_lim3 329 CALL agrif_update_lim3(0) 330 #endif 331 325 332 CALL Agrif_ChildGrid_To_ParentGrid() 326 333 CALL Agrif_Update_ini() … … 497 504 USE agrif_ice 498 505 USE in_out_manager 499 USE agrif_lim3_update500 506 USE agrif_lim3_interp 501 507 USE lib_mpp … … 510 516 ! Controls 511 517 512 ! clem: For some reason, nn_fsbc(child)/=1 does not work properly (signal islargely degraded by the agrif zoom)518 ! clem: For some reason, nn_fsbc(child)/=1 does not work properly (signal can be largely degraded by the agrif zoom) 513 519 ! the run must satisfy CFL=Uice/(dx/dt) < 0.6/nn_fsbc(child) 514 520 ! therefore, if nn_fsbc(child)>1 one must reduce the time-step in proportion to nn_fsbc(child), which is not acceptable 515 ! If a solution is found, the following stop could be removed 516 IF( nn_fsbc > 1 ) CALL ctl_stop('nn_fsbc(child) must be set to 1 otherwise agrif and lim3 donot work properly')521 ! If a solution is found, the following stop could be removed because the rest of the code take nn_fsbc(child) into account 522 IF( nn_fsbc > 1 ) CALL ctl_stop('nn_fsbc(child) must be set to 1 otherwise agrif and sea-ice may not work properly') 517 523 518 524 ! stop if rhot * nn_fsbc(parent) /= N * nn_fsbc(child) with N being integer … … 528 534 lim_nbstep = 0 529 535 530 ! Update in case 2 ways531 !----------------------532 CALL agrif_update_lim3(0)533 534 536 ! 535 537 END SUBROUTINE Agrif_InitValues_cont_lim3
Note: See TracChangeset
for help on using the changeset viewer.