Skip to content
Snippets Groups Projects
Commit 0dd6ddf5 authored by Guillaume Samson's avatar Guillaume Samson :snowman2:
Browse files

Merge branch '129-wrong-icb-melting-flux-depending-on-nn_fsbc' into 'main'

Resolve "Wrong ICB melting flux depending on nn_fsbc"

Closes #129

See merge request nemo/nemo!275
parents bae119a0 26a3d11d
No related branches found
No related tags found
No related merge requests found
......@@ -632,8 +632,10 @@
! ! diagnostics:
ln_bergdia = .true. ! Calculate budgets
nn_verbose_level = 0 ! Turn on more verbose output if level > 0
nn_verbose_write = 15 ! Timesteps between verbose messages
nn_sample_rate = 1 ! Timesteps between sampling for trajectory storage
!
! nn_verbose_write and nn_sample_rate need to be a multiple of nn_fsbc
nn_verbose_write = 16 ! Timesteps between verbose messages
nn_sample_rate = 16 ! Timesteps between sampling for trajectory storage
!
! ! iceberg setting:
! ! Initial mass required for an iceberg of each class
......
......@@ -522,6 +522,16 @@ CONTAINS
CALL ctl_stop( 'icb_nam: a negative rn_distribution value encountered ==>> change your namelist namberg' )
ENDIF
!
! ensure that nn_verbose_write is a multiple of nn_fsbc
IF (MOD(nn_verbose_write, nn_fsbc) /= 0) THEN
CALL ctl_stop( 'icb_nam: nn_verbose_write is not a multiple of nn_fsbc')
END IF
!
! ensure that nn_sample_rate is a multiple of nn_fsbc
IF (MOD(nn_sample_rate, nn_fsbc) /= 0) THEN
CALL ctl_stop( 'icb_nam: nn_sample_rate is not a multiple of nn_fsbc')
END IF
!
END SUBROUTINE icb_nam
!!======================================================================
......
......@@ -68,78 +68,79 @@ CONTAINS
IF( ln_timing ) CALL timing_start('icb_stp')
! !== start of timestep housekeeping ==!
!
nktberg = kt
!
!CALL test_icb_utl_getkb
!CALL ctl_stop('end test icb')
!
IF( nn_test_icebergs < 0 .OR. ln_use_calving ) THEN !* read calving data
IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN
!
CALL fld_read ( kt, 1, sf_icb )
src_calving (:,:) = sf_icb(1)%fnow(:,:,1) ! calving in km^3/year (water equivalent)
src_calving_hflx(:,:) = 0._wp ! NO heat flux for now
nktberg = kt
!
ENDIF
!
berg_grid%floating_melt(:,:) = 0._wp
!
! !* anything that needs to be reset to zero each timestep
CALL icb_dia_step() ! for budgets is dealt with here
!
! !* write out time
ll_verbose = .FALSE.
IF( nn_verbose_write > 0 .AND. MOD( kt-1 , nn_verbose_write ) == 0 ) ll_verbose = ( nn_verbose_level > 0 )
!
IF( ll_verbose ) WRITE(numicb,9100) nktberg, ndastp, nsec_day
9100 FORMAT('kt= ',i8, ' day= ',i8,' secs=',i8)
!
! !* copy nemo forcing arrays into iceberg versions with extra halo
CALL icb_utl_copy( Kmm ) ! only necessary for variables not on T points
!
!
! !== process icebergs ==!
! !
CALL icb_clv_flx( kt ) ! Accumulate ice from calving
! !
CALL icb_clv( kt ) ! Calve excess stored ice into icebergs
! !
!
! !== For each berg, evolve ==!
!
IF( ASSOCIATED(first_berg) ) CALL icb_dyn( kt ) ! ice berg dynamics
IF( lk_mpp ) THEN ; CALL icb_lbc_mpp() ! Send bergs to other PEs
ELSE ; CALL icb_lbc() ! Deal with any cyclic boundaries in non-mpp case
ENDIF
IF( ASSOCIATED(first_berg) ) CALL icb_thm( kt ) ! Ice berg thermodynamics (melting) + rolling
!
!
! !== diagnostics and output ==!
!
! !* For each berg, record trajectory (when needed)
ll_sample_traj = .FALSE.
IF( nn_sample_rate > 0 .AND. MOD(kt-1,nn_sample_rate) == 0 ) ll_sample_traj = .TRUE.
IF( ll_sample_traj .AND. ASSOCIATED(first_berg) ) CALL icb_trj_write( kt )
! !* Gridded diagnostics
! ! To get these iom_put's and those preceding to actually do something
! ! use key_xios in cpp file and create content for XML file
!
CALL iom_put( "calving" , berg_grid%calving (:,:) ) ! 'calving mass input'
CALL iom_put( "berg_floating_melt", berg_grid%floating_melt(:,:) ) ! 'Melt rate of icebergs + bits' , 'kg/m2/s'
CALL iom_put( "berg_stored_ice" , berg_grid%stored_ice (:,:,:) ) ! 'Accumulated ice mass by class', 'kg'
!
CALL icb_dia_put() !* store mean budgets
!
! !* Dump icebergs to screen
IF( nn_verbose_level >= 2 ) CALL icb_utl_print( 'icb_stp, status', kt )
!
! !* Diagnose budgets
ll_budget = .FALSE.
IF( nn_verbose_write > 0 .AND. MOD(kt-1,nn_verbose_write) == 0 ) ll_budget = ln_bergdia
CALL icb_dia( ll_budget )
IF( nn_test_icebergs < 0 .OR. ln_use_calving ) THEN !* read calving data
!
CALL fld_read ( kt, 1, sf_icb )
src_calving (:,:) = sf_icb(1)%fnow(:,:,1) ! calving in km^3/year (water equivalent)
src_calving_hflx(:,:) = 0._wp ! NO heat flux for now
!
ENDIF
!
berg_grid%floating_melt(:,:) = 0._wp
!
! !* anything that needs to be reset to zero each timestep
CALL icb_dia_step() ! for budgets is dealt with here
!
! !* write out time
ll_verbose = .FALSE.
IF( nn_verbose_write > 0 .AND. MOD( kt-1 , nn_verbose_write ) == 0 ) ll_verbose = ( nn_verbose_level > 0 )
!
IF( ll_verbose ) WRITE(numicb,9100) nktberg, ndastp, nsec_day
9100 FORMAT('kt= ',i8, ' day= ',i8,' secs=',i8)
!
! !* copy nemo forcing arrays into iceberg versions with extra halo
CALL icb_utl_copy( Kmm ) ! only necessary for variables not on T points
!
!
! !== process icebergs ==!
! !
CALL icb_clv_flx( kt ) ! Accumulate ice from calving
! !
CALL icb_clv( kt ) ! Calve excess stored ice into icebergs
! !
!
! !== For each berg, evolve ==!
!
IF( ASSOCIATED(first_berg) ) CALL icb_dyn( kt ) ! ice berg dynamics
IF( lk_mpp ) THEN ; CALL icb_lbc_mpp() ! Send bergs to other PEs
ELSE ; CALL icb_lbc() ! Deal with any cyclic boundaries in non-mpp case
ENDIF
IF( ASSOCIATED(first_berg) ) CALL icb_thm( kt ) ! Ice berg thermodynamics (melting) + rolling
!
!
! !== diagnostics and output ==!
!
! !* For each berg, record trajectory (when needed)
ll_sample_traj = .FALSE.
IF( nn_sample_rate > 0 .AND. MOD(kt-1,nn_sample_rate) == 0 ) ll_sample_traj = .TRUE.
IF( ll_sample_traj .AND. ASSOCIATED(first_berg) ) CALL icb_trj_write( kt )
! !* Gridded diagnostics
! ! To get these iom_put's and those preceding to actually do something
! ! use key_xios in cpp file and create content for XML file
!
CALL iom_put( "calving" , berg_grid%calving (:,:) ) ! 'calving mass input'
CALL iom_put( "berg_floating_melt", berg_grid%floating_melt(:,:) ) ! 'Melt rate of icebergs + bits' , 'kg/m2/s'
CALL iom_put( "berg_stored_ice" , berg_grid%stored_ice (:,:,:) ) ! 'Accumulated ice mass by class', 'kg'
!
CALL icb_dia_put() !* store mean budgets
!
! !* Dump icebergs to screen
IF( nn_verbose_level >= 2 ) CALL icb_utl_print( 'icb_stp, status', kt )
!
! !* Diagnose budgets
ll_budget = .FALSE.
IF( nn_verbose_write > 0 .AND. MOD(kt-1,nn_verbose_write) == 0 ) ll_budget = ln_bergdia
CALL icb_dia( ll_budget )
!
END IF
!
IF( lrst_oce ) THEN !* restart
CALL icb_rst_write( kt )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment