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 5708 for branches/UKMO/dev_r5518_coupling_GSI7_GSI8_landice/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2015-08-26T14:49:08+02:00 (9 years ago)
Author:
davestorkey
Message:

Commit changes for icesheet freshwater input code for coupled models without an active icesheet model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_coupling_GSI7_GSI8_landice/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r5680 r5708  
    227227         &                  sn_rcv_qns , sn_rcv_emp   , sn_rcv_rnf   , sn_rcv_cal   , sn_rcv_iceflx,  & 
    228228         &                  sn_rcv_co2 , sn_rcv_grnm  , sn_rcv_antm  , sn_rcv_ts_ice, nn_cplmodel  ,  & 
    229          &                  ln_usecplmask 
     229         &                  ln_usecplmask, ln_coupled_iceshelf_fluxes, rn_greenland_calving_fraction, & 
     230         &                  rn_antarctica_calving_fraction, rn_iceshelf_fluxes_tolerance 
    230231      !!--------------------------------------------------------------------- 
    231232      ! 
     
    285286         WRITE(numout,*)'  nn_cplmodel                         = ', nn_cplmodel 
    286287         WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask 
     288         WRITE(numout,*)'  ln_coupled_iceshelf_fluxes          = ', ln_coupled_iceshelf_fluxes 
     289         WRITE(numout,*)'  rn_greenland_calving_fraction       = ', rn_greenland_calving_fraction 
     290         WRITE(numout,*)'  rn_antarctica_calving_fraction      = ', rn_antarctica_calving_fraction 
     291         WRITE(numout,*)'  rn_iceshelf_fluxes_tolerance        = ', rn_iceshelf_fluxes_tolerance 
    287292      ENDIF 
    288293 
     
    892897      ncpl_qsr_freq = 86400 / ncpl_qsr_freq 
    893898 
     899      IF( ln_coupled_iceshelf_fluxes ) THEN 
     900          ! Crude masks to separate the Antarctic and Greenland icesheets. Obviously something 
     901          ! more complicated could be done if required. 
     902          greenland_icesheet_mask = 0.0 
     903          WHERE( gphit >= 0.0 ) greenland_icesheet_mask = 1.0 
     904          antarctica_icesheet_mask = 0.0 
     905          WHERE( gphit < 0.0 ) antarctica_icesheet_mask = 1.0 
     906 
     907          ! initialise other variables 
     908          greenland_icesheet_mass_array(:,:) = 0.0 
     909          antarctica_icesheet_mass_array(:,:) = 0.0 
     910 
     911          IF( .not. ln_rstart ) THEN 
     912             greenland_icesheet_mass = 0.0  
     913             greenland_icesheet_mass_rate_of_change = 0.0  
     914             greenland_icesheet_timelapsed = 0.0 
     915             antarctica_icesheet_mass = 0.0  
     916             antarctica_icesheet_mass_rate_of_change = 0.0  
     917             antarctica_icesheet_timelapsed = 0.0 
     918          ENDIF 
     919 
     920      ENDIF 
     921 
    894922      CALL wrk_dealloc( jpi,jpj, zacs, zaos ) 
    895923      ! 
     
    953981      INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdttra did not change since nit000) 
    954982      REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars      
     983      REAL(wp) ::   zgreenland_icesheet_mass_in, zantarctica_icesheet_mass_in 
     984      REAL(wp) ::   zgreenland_icesheet_mass_b, zantarctica_icesheet_mass_b 
     985      REAL(wp) ::   zmask_sum, zepsilon       
    955986      REAL(wp) ::   zcoef                  ! temporary scalar 
    956987      REAL(wp) ::   zrhoa  = 1.22          ! Air density kg/m3 
     
    12371268      ENDIF 
    12381269       
    1239       !                                                        ! land ice masses 
    1240       IF( srcv(jpr_grnm)%laction )   greenland_mass_array(:,:) = frcv(jpr_grnm)%z3(:,:,1) 
    1241       IF( srcv(jpr_antm)%laction )   antarctica_mass_array(:,:) = frcv(jpr_antm)%z3(:,:,1) 
    1242       greenland_mass = greenland_mass_array(1,1) 
    1243       antarctica_mass = antarctica_mass_array(1,1) 
    1244           
    1245       WRITE(numout,*) 'Greenland mass is ', greenland_mass 
    1246       WRITE(numout,*) 'Antarctica mass is ', antarctica_mass 
     1270      !                                                        ! land ice masses : Greenland 
     1271      zepsilon = rn_iceshelf_fluxes_tolerance 
     1272 
     1273      IF( srcv(jpr_grnm)%laction ) THEN 
     1274         greenland_icesheet_mass_array(:,:) = frcv(jpr_grnm)%z3(:,:,1) 
     1275         ! take average over ocean points of input array to avoid cumulative error over time 
     1276         zgreenland_icesheet_mass_in = SUM( greenland_icesheet_mass_array(:,:) * tmask(:,:,1) ) 
     1277         IF(lk_mpp) CALL mpp_sum( zgreenland_icesheet_mass_in ) 
     1278         zmask_sum = SUM( tmask(:,:,1) ) 
     1279         IF(lk_mpp) CALL mpp_sum( zmask_sum )  
     1280         zgreenland_icesheet_mass_in = zgreenland_icesheet_mass_in / zmask_sum 
     1281         greenland_icesheet_timelapsed = greenland_icesheet_timelapsed + rdt          
     1282         IF( ABS( zgreenland_icesheet_mass_in - greenland_icesheet_mass )/( greenland_icesheet_mass + zepsilon ) > zepsilon ) THEN 
     1283            zgreenland_icesheet_mass_b = greenland_icesheet_mass 
     1284            greenland_icesheet_mass = zgreenland_icesheet_mass_in 
     1285            IF( zgreenland_icesheet_mass_b /= 0.0 ) & 
     1286           &     greenland_icesheet_mass_rate_of_change = ( greenland_icesheet_mass - zgreenland_icesheet_mass_b ) / greenland_icesheet_timelapsed  
     1287            greenland_icesheet_timelapsed = 0.0_wp        
     1288         ENDIF 
     1289         IF(lwp) WRITE(numout,*) 'Greenland icesheet mass (kg) is ', greenland_icesheet_mass 
     1290         IF(lwp) WRITE(numout,*) 'Greenland icesheet mass rate of change (kg/s) is ', greenland_icesheet_mass_rate_of_change 
     1291         IF(lwp) WRITE(numout,*) 'Greenland icesheet seconds lapsed since last change is ', greenland_icesheet_timelapsed 
     1292      ENDIF 
     1293 
     1294      !                                                        ! land ice masses : Antarctica 
     1295      IF( srcv(jpr_antm)%laction ) THEN 
     1296         antarctica_icesheet_mass_array(:,:) = frcv(jpr_antm)%z3(:,:,1) 
     1297         ! take average over ocean points of input array to avoid cumulative error from rounding errors over time 
     1298         zantarctica_icesheet_mass_in = SUM( antarctica_icesheet_mass_array(:,:) * tmask(:,:,1) ) 
     1299         IF(lk_mpp) CALL mpp_sum( zantarctica_icesheet_mass_in ) 
     1300         zmask_sum = SUM( tmask(:,:,1) ) 
     1301         IF(lk_mpp) CALL mpp_sum( zmask_sum )  
     1302         zantarctica_icesheet_mass_in = zantarctica_icesheet_mass_in / zmask_sum 
     1303         antarctica_icesheet_timelapsed = antarctica_icesheet_timelapsed + rdt          
     1304         IF( ABS( zantarctica_icesheet_mass_in - antarctica_icesheet_mass )/( antarctica_icesheet_mass + zepsilon ) > zepsilon ) THEN 
     1305            zantarctica_icesheet_mass_b = antarctica_icesheet_mass 
     1306            antarctica_icesheet_mass = zantarctica_icesheet_mass_in 
     1307            IF( zantarctica_icesheet_mass_b /= 0.0 ) & 
     1308          &      antarctica_icesheet_mass_rate_of_change = ( antarctica_icesheet_mass - zantarctica_icesheet_mass_b ) / antarctica_icesheet_timelapsed  
     1309            antarctica_icesheet_timelapsed = 0.0_wp        
     1310         ENDIF 
     1311         IF(lwp) WRITE(numout,*) 'Antarctica icesheet mass (kg) is ', antarctica_icesheet_mass 
     1312         IF(lwp) WRITE(numout,*) 'Antarctica icesheet mass rate of change (kg/s) is ', antarctica_icesheet_mass_rate_of_change 
     1313         IF(lwp) WRITE(numout,*) 'Antarctica icesheet seconds lapsed since last change is ', antarctica_icesheet_timelapsed 
     1314      ENDIF 
     1315 
    12471316      ! 
    12481317      CALL wrk_dealloc( jpi,jpj, ztx, zty, zmsk, zemp, zqns, zqsr ) 
Note: See TracChangeset for help on using the changeset viewer.