New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 9124 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90 – NEMO

Ignore:
Timestamp:
2017-12-19T09:26:25+01:00 (6 years ago)
Author:
gm
Message:

dev_merge_2017: ln_timing instead of nn_timing + restricted timing to nemo_init and routine called by step in OPA_SRC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90

    r5215 r9124  
    11MODULE icbstp 
    2  
    32   !!====================================================================== 
    43   !!                       ***  MODULE  icbstp  *** 
     
    1312   !!            -    !                            into icb copies with haloes 
    1413   !!---------------------------------------------------------------------- 
     14 
    1515   !!---------------------------------------------------------------------- 
    1616   !!   icb_stp       : start iceberg tracking 
     
    2020   USE dom_oce        ! ocean domain 
    2121   USE sbc_oce        ! ocean surface forcing 
    22    USE phycst 
     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   ! 
    2335   USE in_out_manager ! nemo IO 
    24    USE lib_mpp 
    25    USE iom 
    26    USE fldread 
     36   USE lib_mpp        ! massively parallel library  
     37   USE iom            ! I/O manager 
     38   USE fldread        ! field read 
    2739   USE timing         ! timing 
    28  
    29    USE icb_oce        ! define iceberg arrays 
    30    USE icbini         ! iceberg initialisation routines 
    31    USE icbutl         ! iceberg utility routines 
    32    USE icbrst         ! iceberg restart routines 
    33    USE icbdyn         ! iceberg dynamics (ie advection) routines 
    34    USE icbclv         ! iceberg calving routines 
    35    USE icbthm         ! iceberg thermodynamics routines 
    36    USE icblbc         ! iceberg lateral boundary routines (including mpp) 
    37    USE icbtrj         ! iceberg trajectory I/O routines 
    38    USE icbdia         ! iceberg budget 
    3940 
    4041   IMPLICIT NONE 
     
    6465      !!---------------------------------------------------------------------- 
    6566      ! 
    66       IF( nn_timing == 1 ) CALL timing_start('icb_stp') 
     67      IF( ln_timing )  CALL timing_start('icb_stp') 
    6768 
    68       !! start of timestep housekeeping 
    69  
     69      !                       !==  start of timestep housekeeping  ==! 
     70      ! 
    7071      nktberg = kt 
    71  
    72       IF( nn_test_icebergs < 0 ) THEN      ! read calving data 
     72      ! 
     73      IF( nn_test_icebergs < 0 ) THEN     !* read calving data 
    7374         ! 
    7475         CALL fld_read ( kt, 1, sf_icb ) 
    75          src_calving(:,:)      = sf_icb(1)%fnow(:,:,1)    ! calving in km^3/year (water equivalent) 
     76         src_calving     (:,:) = sf_icb(1)%fnow(:,:,1)    ! calving in km^3/year (water equivalent) 
    7677         src_calving_hflx(:,:) = 0._wp                    ! NO heat flux for now 
    7778         ! 
    7879      ENDIF 
    79  
     80      ! 
    8081      berg_grid%floating_melt(:,:) = 0._wp 
    81  
    82       ! anything that needs to be reset to zero each timestep for budgets is dealt with here 
    83       CALL icb_dia_step() 
    84  
     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 
    8587      ll_verbose = .FALSE. 
    86       IF( nn_verbose_write > 0 .AND. & 
    87           MOD(kt-1,nn_verbose_write ) == 0 )   ll_verbose = nn_verbose_level >= 0 
    88  
    89       ! write out time 
    90       IF( ll_verbose ) WRITE(numicb,9100) nktberg, ndastp, nsec_day 
     88      IF( nn_verbose_write > 0 .AND. MOD( kt-1 , nn_verbose_write ) == 0 )   ll_verbose = ( nn_verbose_level >= 0 ) 
     89      ! 
     90      IF( ll_verbose )   WRITE(numicb,9100) nktberg, ndastp, nsec_day 
    9191 9100 FORMAT('kt= ',i8, ' day= ',i8,' secs=',i8) 
    92  
    93       ! copy nemo forcing arrays into iceberg versions with extra halo 
    94       ! only necessary for variables not on T points 
    95       CALL icb_utl_copy() 
    96  
    97       !!---------------------------------------------------------------------- 
    98       !! process icebergs 
    99  
     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      !                              ! 
    10099                                     CALL icb_clv_flx( kt )   ! Accumulate ice from calving 
    101  
     100      !                              ! 
    102101                                     CALL icb_clv()           ! Calve excess stored ice into icebergs 
    103  
    104  
    105 !                               !==  For each berg, evolve  ==! 
     102      !                              ! 
     103      ! 
     104      !                       !==  For each berg, evolve  ==! 
    106105      ! 
    107106      IF( ASSOCIATED(first_berg) )   CALL icb_dyn( kt )       ! ice berg dynamics 
    108107 
    109       IF( lk_mpp ) THEN          ;   CALL icb_lbc_mpp()       ! Send bergs to other PEs 
    110       ELSE                       ;   CALL icb_lbc()           ! Deal with any cyclic boundaries in non-mpp case 
     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 
    111110      ENDIF 
    112111 
    113112      IF( ASSOCIATED(first_berg) )   CALL icb_thm( kt )       ! Ice berg thermodynamics (melting) + rolling 
    114  
    115       !!---------------------------------------------------------------------- 
    116       !! end of timestep housekeeping 
    117  
     113      ! 
     114      ! 
     115      !                       !==  diagnostics and output  ==! 
     116      ! 
     117      !                                   !* For each berg, record trajectory (when needed) 
    118118      ll_sample_traj = .FALSE. 
    119119      IF( nn_sample_rate > 0 .AND. MOD(kt-1,nn_sample_rate) == 0 )   ll_sample_traj = .TRUE. 
    120       IF( ll_sample_traj .AND.   & 
    121           ASSOCIATED(first_berg) )   CALL icb_trj_write( kt )  ! For each berg, record trajectory 
     120      IF( ll_sample_traj .AND. ASSOCIATED(first_berg) )   CALL icb_trj_write( kt ) 
    122121 
    123       ! Gridded diagnostics 
    124       ! To get these iom_put's and those preceding to actually do something 
    125       ! use key_iomput in cpp file and create content for XML file 
    126  
     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      ! 
    127126      CALL iom_put( "calving"           , berg_grid%calving      (:,:)   )  ! 'calving mass input' 
    128127      CALL iom_put( "berg_floating_melt", berg_grid%floating_melt(:,:)   )  ! 'Melt rate of icebergs + bits' , 'kg/m2/s' 
    129128      CALL iom_put( "berg_stored_ice"   , berg_grid%stored_ice   (:,:,:) )  ! 'Accumulated ice mass by class', 'kg' 
    130  
    131       ! store mean budgets 
    132       CALL icb_dia_put() 
    133  
    134       ! Dump icebergs to screen 
    135       if ( nn_verbose_level >= 2 )   CALL icb_utl_print( 'icb_stp, status', kt ) 
    136  
    137       ! Diagnose budgets 
     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 
    138136      ll_budget = .FALSE. 
    139137      IF( nn_verbose_write > 0 .AND. MOD(kt-1,nn_verbose_write) == 0 )   ll_budget = ln_bergdia 
    140138      CALL icb_dia( ll_budget ) 
    141  
    142       IF( MOD(kt,nn_stock) == 0 ) THEN 
     139      ! 
     140      IF( MOD(kt,nn_stock) == 0 ) THEN    !* restart 
    143141         CALL icb_rst_write( kt ) 
    144142         IF( nn_sample_rate > 0 )   CALL icb_trj_sync() 
    145143      ENDIF 
    146  
    147       IF( nn_timing == 1 ) CALL timing_stop('icb_stp') 
     144      ! 
     145      IF( ln_timing )  CALL timing_stop('icb_stp') 
    148146      ! 
    149147   END SUBROUTINE icb_stp 
     
    157155      !! 
    158156      !!---------------------------------------------------------------------- 
    159       INTEGER, INTENT( in )  :: kt 
     157      INTEGER, INTENT( in )  ::   kt   ! model time-step index 
    160158      !!---------------------------------------------------------------------- 
    161  
     159      ! 
    162160      ! only write a restart if not done in icb_stp 
    163       IF( MOD(kt,nn_stock) .NE. 0 ) CALL icb_rst_write( kt ) 
     161      IF( MOD(kt,nn_stock) /= 0 )  CALL icb_rst_write( kt ) 
    164162 
    165163      ! finish with trajectories if they were written 
    166       IF( nn_sample_rate .GT. 0 ) CALL icb_trj_end() 
     164      IF( nn_sample_rate > 0 )  CALL icb_trj_end() 
    167165 
    168       IF(lwp)   WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea 
     166      IF(lwp) WRITE(numout,'(a,i6)') 'icebergs: icb_end complete', narea 
     167      ! 
    169168      CALL flush( numicb ) 
    170169      CLOSE( numicb ) 
     
    173172 
    174173   !!------------------------------------------------------------------------- 
    175  
    176174END MODULE icbstp 
Note: See TracChangeset for help on using the changeset viewer.