[3614] | 1 | MODULE icbstp |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE icbstp *** |
---|
| 4 | !! Icebergs: initialise variables for iceberg tracking |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : 3.3.1 ! 2010-01 (Martin&Adcroft) Original code |
---|
| 7 | !! - ! 2011-03 (Madec) Part conversion to NEMO form |
---|
| 8 | !! - ! Removal of mapping from another grid |
---|
| 9 | !! - ! 2011-04 (Alderson) Split into separate modules |
---|
| 10 | !! - ! Move budgets to icbdia routine |
---|
| 11 | !! - ! 2011-05 (Alderson) Add call to copy forcing arrays |
---|
| 12 | !! - ! into icb copies with haloes |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[9124] | 14 | |
---|
[3614] | 15 | !!---------------------------------------------------------------------- |
---|
| 16 | !! icb_stp : start iceberg tracking |
---|
| 17 | !! icb_end : end iceberg tracking |
---|
| 18 | !!---------------------------------------------------------------------- |
---|
| 19 | USE par_oce ! nemo parameters |
---|
| 20 | USE dom_oce ! ocean domain |
---|
| 21 | USE sbc_oce ! ocean surface forcing |
---|
[9124] | 22 | USE phycst ! physical constants |
---|
| 23 | ! |
---|
| 24 | USE icb_oce ! iceberg: define arrays |
---|
| 25 | USE icbini ! iceberg: initialisation routines |
---|
| 26 | USE icbutl ! iceberg: utility routines |
---|
| 27 | USE icbrst ! iceberg: restart routines |
---|
| 28 | USE icbdyn ! iceberg: dynamics (ie advection) routines |
---|
| 29 | USE icbclv ! iceberg: calving routines |
---|
| 30 | USE icbthm ! iceberg: thermodynamics routines |
---|
| 31 | USE icblbc ! iceberg: lateral boundary routines (including mpp) |
---|
| 32 | USE icbtrj ! iceberg: trajectory I/O routines |
---|
| 33 | USE icbdia ! iceberg: budget |
---|
| 34 | ! |
---|
[3614] | 35 | USE in_out_manager ! nemo IO |
---|
[9124] | 36 | USE lib_mpp ! massively parallel library |
---|
| 37 | USE iom ! I/O manager |
---|
| 38 | USE fldread ! field read |
---|
[3614] | 39 | USE timing ! timing |
---|
| 40 | |
---|
| 41 | IMPLICIT NONE |
---|
| 42 | PRIVATE |
---|
| 43 | |
---|
| 44 | PUBLIC icb_stp ! routine called in sbcmod.F90 module |
---|
| 45 | PUBLIC icb_end ! routine called in nemogcm.F90 module |
---|
| 46 | |
---|
| 47 | !!---------------------------------------------------------------------- |
---|
[9598] | 48 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[5215] | 49 | !! $Id$ |
---|
[10068] | 50 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[3614] | 51 | !!---------------------------------------------------------------------- |
---|
| 52 | CONTAINS |
---|
| 53 | |
---|
| 54 | SUBROUTINE icb_stp( kt ) |
---|
| 55 | !!---------------------------------------------------------------------- |
---|
| 56 | !! *** ROUTINE icb_stp *** |
---|
| 57 | !! |
---|
| 58 | !! ** Purpose : iceberg time stepping. |
---|
| 59 | !! |
---|
| 60 | !! ** Method : - top level routine to do things in the correct order |
---|
| 61 | !!---------------------------------------------------------------------- |
---|
| 62 | INTEGER, INTENT(in) :: kt ! time step index |
---|
| 63 | ! |
---|
| 64 | LOGICAL :: ll_sample_traj, ll_budget, ll_verbose ! local logical |
---|
| 65 | !!---------------------------------------------------------------------- |
---|
| 66 | ! |
---|
[9124] | 67 | IF( ln_timing ) CALL timing_start('icb_stp') |
---|
[3614] | 68 | |
---|
[9124] | 69 | ! !== start of timestep housekeeping ==! |
---|
| 70 | ! |
---|
[3614] | 71 | nktberg = kt |
---|
[9124] | 72 | ! |
---|
[9932] | 73 | IF( nn_test_icebergs < 0 .OR. ln_use_calving ) THEN !* read calving data |
---|
[3614] | 74 | ! |
---|
| 75 | CALL fld_read ( kt, 1, sf_icb ) |
---|
[9124] | 76 | src_calving (:,:) = sf_icb(1)%fnow(:,:,1) ! calving in km^3/year (water equivalent) |
---|
[3614] | 77 | src_calving_hflx(:,:) = 0._wp ! NO heat flux for now |
---|
| 78 | ! |
---|
| 79 | ENDIF |
---|
[9124] | 80 | ! |
---|
[3614] | 81 | berg_grid%floating_melt(:,:) = 0._wp |
---|
[9124] | 82 | ! |
---|
| 83 | ! !* anything that needs to be reset to zero each timestep |
---|
| 84 | CALL icb_dia_step() ! for budgets is dealt with here |
---|
| 85 | ! |
---|
| 86 | ! !* write out time |
---|
[3614] | 87 | ll_verbose = .FALSE. |
---|
[11536] | 88 | IF( nn_verbose_write > 0 .AND. MOD( kt-1 , nn_verbose_write ) == 0 ) ll_verbose = ( nn_verbose_level > 0 ) |
---|
[9124] | 89 | ! |
---|
| 90 | IF( ll_verbose ) WRITE(numicb,9100) nktberg, ndastp, nsec_day |
---|
[3614] | 91 | 9100 FORMAT('kt= ',i8, ' day= ',i8,' secs=',i8) |
---|
[9124] | 92 | ! |
---|
| 93 | ! !* copy nemo forcing arrays into iceberg versions with extra halo |
---|
| 94 | CALL icb_utl_copy() ! only necessary for variables not on T points |
---|
| 95 | ! |
---|
| 96 | ! |
---|
| 97 | ! !== process icebergs ==! |
---|
| 98 | ! ! |
---|
[3614] | 99 | CALL icb_clv_flx( kt ) ! Accumulate ice from calving |
---|
[9124] | 100 | ! ! |
---|
[9932] | 101 | CALL icb_clv( kt ) ! Calve excess stored ice into icebergs |
---|
[9124] | 102 | ! ! |
---|
[3614] | 103 | ! |
---|
[9124] | 104 | ! !== For each berg, evolve ==! |
---|
| 105 | ! |
---|
[4990] | 106 | IF( ASSOCIATED(first_berg) ) CALL icb_dyn( kt ) ! ice berg dynamics |
---|
[3614] | 107 | |
---|
[9124] | 108 | IF( lk_mpp ) THEN ; CALL icb_lbc_mpp() ! Send bergs to other PEs |
---|
| 109 | ELSE ; CALL icb_lbc() ! Deal with any cyclic boundaries in non-mpp case |
---|
[3614] | 110 | ENDIF |
---|
| 111 | |
---|
| 112 | IF( ASSOCIATED(first_berg) ) CALL icb_thm( kt ) ! Ice berg thermodynamics (melting) + rolling |
---|
[9124] | 113 | ! |
---|
| 114 | ! |
---|
| 115 | ! !== diagnostics and output ==! |
---|
| 116 | ! |
---|
| 117 | ! !* For each berg, record trajectory (when needed) |
---|
[3614] | 118 | ll_sample_traj = .FALSE. |
---|
| 119 | IF( nn_sample_rate > 0 .AND. MOD(kt-1,nn_sample_rate) == 0 ) ll_sample_traj = .TRUE. |
---|
[9124] | 120 | IF( ll_sample_traj .AND. ASSOCIATED(first_berg) ) CALL icb_trj_write( kt ) |
---|
[3614] | 121 | |
---|
[9124] | 122 | ! !* Gridded diagnostics |
---|
| 123 | ! ! To get these iom_put's and those preceding to actually do something |
---|
| 124 | ! ! use key_iomput in cpp file and create content for XML file |
---|
| 125 | ! |
---|
[3614] | 126 | CALL iom_put( "calving" , berg_grid%calving (:,:) ) ! 'calving mass input' |
---|
| 127 | CALL iom_put( "berg_floating_melt", berg_grid%floating_melt(:,:) ) ! 'Melt rate of icebergs + bits' , 'kg/m2/s' |
---|
| 128 | CALL iom_put( "berg_stored_ice" , berg_grid%stored_ice (:,:,:) ) ! 'Accumulated ice mass by class', 'kg' |
---|
[9124] | 129 | ! |
---|
| 130 | CALL icb_dia_put() !* store mean budgets |
---|
| 131 | ! |
---|
| 132 | ! !* Dump icebergs to screen |
---|
| 133 | IF( nn_verbose_level >= 2 ) CALL icb_utl_print( 'icb_stp, status', kt ) |
---|
| 134 | ! |
---|
| 135 | ! !* Diagnose budgets |
---|
[3614] | 136 | ll_budget = .FALSE. |
---|
| 137 | IF( nn_verbose_write > 0 .AND. MOD(kt-1,nn_verbose_write) == 0 ) ll_budget = ln_bergdia |
---|
| 138 | CALL icb_dia( ll_budget ) |
---|
[9124] | 139 | ! |
---|
[9328] | 140 | IF( lrst_oce ) THEN !* restart |
---|
[3614] | 141 | CALL icb_rst_write( kt ) |
---|
| 142 | IF( nn_sample_rate > 0 ) CALL icb_trj_sync() |
---|
| 143 | ENDIF |
---|
| 144 | ! |
---|
[9124] | 145 | IF( ln_timing ) CALL timing_stop('icb_stp') |
---|
| 146 | ! |
---|
[3614] | 147 | END SUBROUTINE icb_stp |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | SUBROUTINE icb_end( kt ) |
---|
| 151 | !!---------------------------------------------------------------------- |
---|
| 152 | !! *** ROUTINE icb_end *** |
---|
| 153 | !! |
---|
| 154 | !! ** Purpose : close iceberg files |
---|
| 155 | !! |
---|
| 156 | !!---------------------------------------------------------------------- |
---|
[9124] | 157 | INTEGER, INTENT( in ) :: kt ! model time-step index |
---|
[3614] | 158 | !!---------------------------------------------------------------------- |
---|
[9124] | 159 | ! |
---|
[3614] | 160 | ! finish with trajectories if they were written |
---|
[9124] | 161 | IF( nn_sample_rate > 0 ) CALL icb_trj_end() |
---|
[3614] | 162 | |
---|
[9124] | 163 | IF(lwp) WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea |
---|
| 164 | ! |
---|
[10570] | 165 | IF( nn_verbose_level > 0 ) THEN |
---|
| 166 | CALL flush( numicb ) |
---|
| 167 | CLOSE( numicb ) |
---|
| 168 | ENDIF |
---|
[3614] | 169 | ! |
---|
| 170 | END SUBROUTINE icb_end |
---|
| 171 | |
---|
[9190] | 172 | !!====================================================================== |
---|
[3614] | 173 | END MODULE icbstp |
---|