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 13778 for NEMO/branches/UKMO/NEMO_4.0.3_icesheet_and_river_coupling/src/OCE/SBC/sbcisf.F90 – NEMO

Ignore:
Timestamp:
2020-11-11T14:27:17+01:00 (3 years ago)
Author:
dancopsey
Message:

Merge in existing changes from NEMO_4.0.1 version of this branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.3_icesheet_and_river_coupling/src/OCE/SBC/sbcisf.F90

    r13587 r13778  
    9292      INTEGER ::   ji, jj, jk   ! loop index 
    9393      INTEGER ::   ikt, ikb     ! local integers 
     94      REAL(wp)                     ::   zgreenland_fwfisf_sum, zantarctica_fwfisf_sum  
    9495      REAL(wp), DIMENSION(jpi,jpj) ::   zt_frz, zdep   ! freezing temperature (zt_frz) at depth (zdep)  
    9596      REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   zqhcisf2d 
    9697      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   zfwfisf3d, zqhcisf3d, zqlatisf3d 
     98      LOGICAL :: ll_wrtstp 
    9799      !!--------------------------------------------------------------------- 
    98100      ! 
     101      ll_wrtstp  = (( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend )) .AND. (nn_print>0) 
    99102      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN    ! compute salt and heat flux 
    100103         ! 
     
    127130               fwfisf(:,:) = - sf_rnfisf(1)%fnow(:,:,1)         ! fresh water flux from the isf (fwfisf <0 mean melting)  
    128131            ENDIF 
     132 
     133            IF( lk_oasis) THEN 
     134              ! nn_coupled_iceshelf_fluxes uninitialised unless lk_oasis=true 
     135              IF( nn_coupled_iceshelf_fluxes .gt. 0 ) THEN 
     136 
     137                ! Adjust total iceshelf melt rates so that sum of iceberg calving and iceshelf melting in the northern 
     138                ! and southern hemispheres equals rate of increase of mass of greenland and antarctic ice sheets 
     139                ! to preserve total freshwater conservation in coupled models without an active ice sheet model. 
     140 
     141                ! All related global sums must be done bit reproducibly 
     142                 zgreenland_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * greenland_icesheet_mask(:,:) ) 
     143 
     144                 ! use ABS function because we need to preserve the sign of fwfisf 
     145                 WHERE( greenland_icesheet_mask(:,:) == 1.0 )                                                                  & 
     146                &    fwfisf(:,:) = fwfisf(:,:)  * ABS( greenland_icesheet_mass_rate_of_change * (1.0-rn_greenland_calving_fraction) & 
     147                &                           / ( zgreenland_fwfisf_sum + 1.0e-10_wp ) ) 
     148 
     149                 ! check 
     150                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Greenland iceshelf melting climatology (kg/s) : ',zgreenland_fwfisf_sum 
     151 
     152                 zgreenland_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * greenland_icesheet_mask(:,:) ) 
     153 
     154                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Greenland iceshelf melting adjusted value (kg/s) : ',zgreenland_fwfisf_sum 
     155 
     156                 zantarctica_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * antarctica_icesheet_mask(:,:) ) 
     157 
     158                 ! use ABS function because we need to preserve the sign of fwfisf 
     159                 WHERE( antarctica_icesheet_mask(:,:) == 1.0 ) & 
     160                &    fwfisf(:,:) = fwfisf(:,:)  * ABS( antarctica_icesheet_mass_rate_of_change * (1.0-rn_antarctica_calving_fraction) & 
     161                &                           / ( zantarctica_fwfisf_sum + 1.0e-10_wp ) ) 
     162 
     163                 ! check 
     164                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Antarctica iceshelf melting climatology (kg/s) : ',zantarctica_fwfisf_sum 
     165 
     166                 zantarctica_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * antarctica_icesheet_mask(:,:) ) 
     167 
     168                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Antarctica iceshelf melting adjusted value (kg/s) : ',zantarctica_fwfisf_sum 
     169 
     170              ENDIF 
     171            ENDIF 
     172 
    129173            qisf(:,:)   = fwfisf(:,:) * rLfusisf             ! heat flux 
    130174            stbl(:,:)   = soce 
     
    137181               fwfisf(:,:) = -sf_fwfisf(1)%fnow(:,:,1)            ! fwf 
    138182            ENDIF 
     183 
     184            IF( lk_oasis) THEN 
     185              ! nn_coupled_iceshelf_fluxes uninitialised unless lk_oasis=true 
     186              IF( nn_coupled_iceshelf_fluxes .gt. 0 ) THEN 
     187 
     188                ! Adjust total iceshelf melt rates so that sum of iceberg calving and iceshelf melting in the northern 
     189                ! and southern hemispheres equals rate of increase of mass of greenland and antarctic ice sheets 
     190                ! to preserve total freshwater conservation in coupled models without an active ice sheet model. 
     191 
     192                ! All related global sums must be done bit reproducibly 
     193                 zgreenland_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * greenland_icesheet_mask(:,:) ) 
     194 
     195                 ! use ABS function because we need to preserve the sign of fwfisf 
     196                 WHERE( greenland_icesheet_mask(:,:) == 1.0 )                                                                  & 
     197                &    fwfisf(:,:) = fwfisf(:,:)  * ABS( greenland_icesheet_mass_rate_of_change * (1.0-rn_greenland_calving_fraction) & 
     198                &                           / ( zgreenland_fwfisf_sum + 1.0e-10_wp ) ) 
     199 
     200                 ! check 
     201                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Greenland iceshelf melting climatology (kg/s) : ',zgreenland_fwfisf_sum 
     202 
     203                 zgreenland_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * greenland_icesheet_mask(:,:) ) 
     204 
     205                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Greenland iceshelf melting adjusted value (kg/s) : ',zgreenland_fwfisf_sum 
     206 
     207                 zantarctica_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * antarctica_icesheet_mask(:,:) ) 
     208 
     209                 ! use ABS function because we need to preserve the sign of fwfisf 
     210                 WHERE( antarctica_icesheet_mask(:,:) == 1.0 ) & 
     211                &    fwfisf(:,:) = fwfisf(:,:)  * ABS( antarctica_icesheet_mass_rate_of_change * (1.0-rn_antarctica_calving_fraction) & 
     212                &                           / ( zantarctica_fwfisf_sum + 1.0e-10_wp ) ) 
     213 
     214                 ! check 
     215                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Antarctica iceshelf melting climatology (kg/s) : ',zantarctica_fwfisf_sum 
     216 
     217                 zantarctica_fwfisf_sum = glob_sum( 'sbcisf', fwfisf(:,:) * e1t(:,:) * e2t(:,:) * antarctica_icesheet_mask(:,:) ) 
     218 
     219                 IF(lwp .AND. ll_wrtstp) WRITE(numout, *) 'Antarctica iceshelf melting adjusted value (kg/s) : ',zantarctica_fwfisf_sum 
     220 
     221              ENDIF 
     222            ENDIF 
     223 
    139224            qisf(:,:)   = fwfisf(:,:) * rLfusisf               ! heat flux 
    140225            stbl(:,:)   = soce 
Note: See TracChangeset for help on using the changeset viewer.