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 12576 for NEMO/branches/UKMO/NEMO_4.0.1_icesheet_and_river_coupling/src/OCE/SBC/sbccpl.F90 – NEMO

Ignore:
Timestamp:
2020-03-20T12:39:37+01:00 (4 years ago)
Author:
dancopsey
Message:

Merge in iceberg calving stuff from dev_r5518_coupling_GSI7_GSI8_landice from the start of the branch to revision 6023.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.1_icesheet_and_river_coupling/src/OCE/SBC/sbccpl.F90

    r11715 r12576  
    116116   INTEGER, PARAMETER ::   jpr_tauwy  = 56   ! y component of the ocean stress from waves 
    117117   INTEGER, PARAMETER ::   jpr_ts_ice = 57   ! Sea ice surface temp 
    118  
    119    INTEGER, PARAMETER ::   jprcv      = 57   ! total number of fields received   
     118   INTEGER, PARAMETER ::   jpr_grnm   = 58   ! Greenland ice mass  
     119   INTEGER, PARAMETER ::   jpr_antm   = 59   ! Antarctic ice mass  
     120 
     121   INTEGER, PARAMETER ::   jprcv      = 59   ! total number of fields received   
    120122 
    121123   INTEGER, PARAMETER ::   jps_fice   =  1   ! ice fraction sent to the atmosphere 
     
    174176   TYPE(FLD_C) ::   sn_rcv_w10m, sn_rcv_taumod, sn_rcv_tau, sn_rcv_tauw, sn_rcv_dqnsdt, sn_rcv_qsr,  & 
    175177      &             sn_rcv_qns , sn_rcv_emp   , sn_rcv_rnf, sn_rcv_ts_ice 
    176    TYPE(FLD_C) ::   sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2, sn_rcv_mslp, sn_rcv_icb, sn_rcv_isf 
     178   TYPE(FLD_C) ::   sn_rcv_cal, sn_rcv_iceflx, sn_rcv_co2, sn_rcv_mslp, sn_rcv_icb, sn_rcv_isf,      & 
     179                    sn_rcv_grnm, sn_rcv_antm 
    177180   ! Send to waves  
    178181   TYPE(FLD_C) ::   sn_snd_ifrac, sn_snd_crtw, sn_snd_wlev  
     
    256259         &                  sn_rcv_iceflx, sn_rcv_co2   , nn_cplmodel , ln_usecplmask, sn_rcv_mslp ,   & 
    257260         &                  sn_rcv_icb   , sn_rcv_isf   , sn_rcv_wfreq , sn_rcv_tauw, nn_cats_cpl  ,   & 
    258          &                  sn_rcv_ts_ice 
     261         &                  sn_rcv_ts_ice, sn_rcv_grnm  , sn_rcv_antm  , nn_coupled_iceshelf_fluxes,   & 
     262         &                  rn_greenland_calving_fraction, rn_antarctica_calving_fraction,             & 
     263         &                  rn_iceshelf_fluxes_tolerance 
    259264 
    260265      !!--------------------------------------------------------------------- 
     
    292297         WRITE(numout,*)'      runoffs                         = ', TRIM(sn_rcv_rnf%cldes   ), ' (', TRIM(sn_rcv_rnf%clcat   ), ')' 
    293298         WRITE(numout,*)'      calving                         = ', TRIM(sn_rcv_cal%cldes   ), ' (', TRIM(sn_rcv_cal%clcat   ), ')' 
     299         WRITE(numout,*)'      Greenland ice mass              = ', TRIM(sn_rcv_grnm%cldes  ), ' (', TRIM(sn_rcv_grnm%clcat  ), ')'  
     300         WRITE(numout,*)'      Antarctica ice mass             = ', TRIM(sn_rcv_antm%cldes  ), ' (', TRIM(sn_rcv_antm%clcat  ), ')'  
    294301         WRITE(numout,*)'      iceberg                         = ', TRIM(sn_rcv_icb%cldes   ), ' (', TRIM(sn_rcv_icb%clcat   ), ')' 
    295302         WRITE(numout,*)'      ice shelf                       = ', TRIM(sn_rcv_isf%cldes   ), ' (', TRIM(sn_rcv_isf%clcat   ), ')' 
     
    330337         WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask 
    331338         WRITE(numout,*)'  nn_cats_cpl                         = ', nn_cats_cpl 
     339         WRITE(numout,*)'  nn_coupled_iceshelf_fluxes          = ', nn_coupled_iceshelf_fluxes  
     340         WRITE(numout,*)'  ln_iceshelf_init_atmos              = ', ln_iceshelf_init_atmos 
     341         WRITE(numout,*)'  rn_greenland_total_fw_flux         = ', rn_greenland_total_fw_flux 
     342         WRITE(numout,*)'  rn_antarctica_total_fw_flux        = ', rn_antarctica_total_fw_flux 
     343         WRITE(numout,*)'  rn_greenland_calving_fraction       = ', rn_greenland_calving_fraction  
     344         WRITE(numout,*)'  rn_antarctica_calving_fraction      = ', rn_antarctica_calving_fraction  
     345         WRITE(numout,*)'  rn_iceshelf_fluxes_tolerance        = ', rn_iceshelf_fluxes_tolerance  
    332346      ENDIF 
    333347 
     
    471485      ! 
    472486      srcv(jpr_cal)%clname = 'OCalving'   ;  IF( TRIM( sn_rcv_cal%cldes) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE. 
     487      srcv(jpr_grnm  )%clname = 'OGrnmass'   ;   IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' )   srcv(jpr_grnm)%laction = .TRUE.  
     488      srcv(jpr_antm  )%clname = 'OAntmass'   ;   IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' )   srcv(jpr_antm)%laction = .TRUE.  
    473489      srcv(jpr_isf)%clname = 'OIcshelf'   ;  IF( TRIM( sn_rcv_isf%cldes) == 'coupled' )   srcv(jpr_isf)%laction = .TRUE. 
    474490      srcv(jpr_icb)%clname = 'OIceberg'   ;  IF( TRIM( sn_rcv_icb%cldes) == 'coupled' )   srcv(jpr_icb)%laction = .TRUE. 
     
    10451061         &   CALL ctl_stop( 'sbc_cpl_init: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' ) 
    10461062      IF( ln_dm2dc .AND. ln_cpl ) ncpl_qsr_freq = 86400 / ncpl_qsr_freq 
     1063 
     1064      IF( nn_coupled_iceshelf_fluxes .gt. 0 ) THEN  
     1065          ! Crude masks to separate the Antarctic and Greenland icesheets. Obviously something  
     1066          ! more complicated could be done if required.  
     1067          greenland_icesheet_mask = 0.0  
     1068          WHERE( gphit >= 0.0 ) greenland_icesheet_mask = 1.0  
     1069          antarctica_icesheet_mask = 0.0  
     1070          WHERE( gphit < 0.0 ) antarctica_icesheet_mask = 1.0  
     1071  
     1072          ! initialise other variables  
     1073          greenland_icesheet_mass_array(:,:) = 0.0  
     1074          antarctica_icesheet_mass_array(:,:) = 0.0  
     1075  
     1076          IF( .not. ln_rstart ) THEN  
     1077             greenland_icesheet_mass = 0.0   
     1078             greenland_icesheet_mass_rate_of_change = 0.0   
     1079             greenland_icesheet_timelapsed = 0.0  
     1080             antarctica_icesheet_mass = 0.0   
     1081             antarctica_icesheet_mass_rate_of_change = 0.0   
     1082             antarctica_icesheet_timelapsed = 0.0  
     1083          ENDIF  
     1084  
     1085      ENDIF  
    10471086      ! 
    10481087   END SUBROUTINE sbc_cpl_init 
     
    11031142      INTEGER  ::   ji, jj, jn             ! dummy loop indices 
    11041143      INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdt did not change since nit000) 
    1105       REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars      
     1144      REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars   
     1145      REAL(wp) ::   zgreenland_icesheet_mass_in, zantarctica_icesheet_mass_in  
     1146      REAL(wp) ::   zgreenland_icesheet_mass_b, zantarctica_icesheet_mass_b  
     1147      REAL(wp) ::   zmask_sum, zepsilon     
    11061148      REAL(wp) ::   zcoef                  ! temporary scalar 
    11071149      REAL(wp) ::   zrhoa  = 1.22          ! Air density kg/m3 
     
    14451487         IF( srcv(jpr_fice )%laction )   fr_i(:,:) = frcv(jpr_fice )%z3(:,:,1) 
    14461488         ! 
     1489      ENDIF 
     1490 
     1491      !                                                        ! land ice masses : Greenland 
     1492      zepsilon = rn_iceshelf_fluxes_tolerance 
     1493 
     1494      IF( srcv(jpr_grnm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN 
     1495       
     1496         ! This is a zero dimensional, single value field.  
     1497         zgreenland_icesheet_mass_in =  frcv(jpr_grnm)%z3(1,1,1) 
     1498            
     1499         greenland_icesheet_timelapsed = greenland_icesheet_timelapsed + rdt          
     1500 
     1501         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN 
     1502            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart 
     1503            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts. 
     1504            zgreenland_icesheet_mass_b = zgreenland_icesheet_mass_in 
     1505            greenland_icesheet_mass = zgreenland_icesheet_mass_in 
     1506         ENDIF 
     1507 
     1508         IF( ABS( zgreenland_icesheet_mass_in - greenland_icesheet_mass ) > zepsilon ) THEN 
     1509            zgreenland_icesheet_mass_b = greenland_icesheet_mass 
     1510             
     1511            ! Only update the mass if it has increased. 
     1512            IF ( (zgreenland_icesheet_mass_in - greenland_icesheet_mass) > 0.0 ) THEN 
     1513               greenland_icesheet_mass = zgreenland_icesheet_mass_in 
     1514            ENDIF 
     1515             
     1516            IF( zgreenland_icesheet_mass_b /= 0.0 ) & 
     1517           &     greenland_icesheet_mass_rate_of_change = ( greenland_icesheet_mass - zgreenland_icesheet_mass_b ) / greenland_icesheet_timelapsed  
     1518            greenland_icesheet_timelapsed = 0.0_wp        
     1519         ENDIF 
     1520         IF(lwp .AND. ll_wrtstp) THEN 
     1521            WRITE(numout,*) 'Greenland icesheet mass (kg) read in is ', zgreenland_icesheet_mass_in 
     1522            WRITE(numout,*) 'Greenland icesheet mass (kg) used is    ', greenland_icesheet_mass 
     1523            WRITE(numout,*) 'Greenland icesheet mass rate of change (kg/s) is ', greenland_icesheet_mass_rate_of_change 
     1524            WRITE(numout,*) 'Greenland icesheet seconds lapsed since last change is ', greenland_icesheet_timelapsed 
     1525            IF(lflush) CALL flush(numout) 
     1526         ENDIF 
     1527      ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN 
     1528         greenland_icesheet_mass_rate_of_change = rn_greenland_total_fw_flux 
     1529      ENDIF 
     1530 
     1531      !                                                        ! land ice masses : Antarctica 
     1532      IF( srcv(jpr_antm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN 
     1533          
     1534         ! This is a zero dimensional, single value field.  
     1535         zantarctica_icesheet_mass_in = frcv(jpr_antm)%z3(1,1,1) 
     1536            
     1537         antarctica_icesheet_timelapsed = antarctica_icesheet_timelapsed + rdt          
     1538 
     1539         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN 
     1540            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart 
     1541            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts. 
     1542            zantarctica_icesheet_mass_b = zantarctica_icesheet_mass_in 
     1543            antarctica_icesheet_mass = zantarctica_icesheet_mass_in 
     1544         ENDIF 
     1545 
     1546         IF( ABS( zantarctica_icesheet_mass_in - antarctica_icesheet_mass ) > zepsilon ) THEN 
     1547            zantarctica_icesheet_mass_b = antarctica_icesheet_mass 
     1548             
     1549            ! Only update the mass if it has increased. 
     1550            IF ( (zantarctica_icesheet_mass_in - antarctica_icesheet_mass) > 0.0 ) THEN 
     1551               antarctica_icesheet_mass = zantarctica_icesheet_mass_in 
     1552            END IF 
     1553             
     1554            IF( zantarctica_icesheet_mass_b /= 0.0 ) & 
     1555          &      antarctica_icesheet_mass_rate_of_change = ( antarctica_icesheet_mass - zantarctica_icesheet_mass_b ) / antarctica_icesheet_timelapsed  
     1556            antarctica_icesheet_timelapsed = 0.0_wp        
     1557         ENDIF 
     1558         IF(lwp .AND. ll_wrtstp) THEN 
     1559            WRITE(numout,*) 'Antarctica icesheet mass (kg) read in is ', zantarctica_icesheet_mass_in 
     1560            WRITE(numout,*) 'Antarctica icesheet mass (kg) used is    ', antarctica_icesheet_mass 
     1561            WRITE(numout,*) 'Antarctica icesheet mass rate of change (kg/s) is ', antarctica_icesheet_mass_rate_of_change 
     1562            WRITE(numout,*) 'Antarctica icesheet seconds lapsed since last change is ', antarctica_icesheet_timelapsed 
     1563            IF(lflush) CALL flush(numout) 
     1564         ENDIF 
     1565      ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN 
     1566         antarctica_icesheet_mass_rate_of_change = rn_antarctica_total_fw_flux 
    14471567      ENDIF 
    14481568      ! 
Note: See TracChangeset for help on using the changeset viewer.