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 7923 for branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

Ignore:
Timestamp:
2017-04-18T15:26:56+02:00 (7 years ago)
Author:
andmirek
Message:

merge changes up to 7573

Location:
branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/SBC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r6488 r7923  
    155155   LOGICAL, PUBLIC     ::   ln_coupled_iceshelf_fluxes     ! If true use rate of change of mass of Greenland and Antarctic icesheets to set the  
    156156                                                           ! combined magnitude of the iceberg calving and iceshelf melting freshwater fluxes. 
     157   LOGICAL, PUBLIC     ::   ln_iceshelf_init_atmos         ! If true force ocean to initialise iceshelf masses from atmospheric values rather 
     158                                                           ! than values in ocean restart. 
    157159   REAL(wp), PUBLIC    ::   rn_greenland_calving_fraction  ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting. 
    158160   REAL(wp), PUBLIC    ::   rn_antarctica_calving_fraction ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting. 
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r6912 r7923  
    240240         &                  sn_rcv_qns , sn_rcv_emp   , sn_rcv_rnf   , sn_rcv_cal   , sn_rcv_iceflx,  & 
    241241         &                  sn_rcv_co2 , sn_rcv_grnm  , sn_rcv_antm  , sn_rcv_ts_ice, nn_cplmodel  ,  & 
    242          &                  ln_usecplmask, ln_coupled_iceshelf_fluxes, rn_greenland_calving_fraction, & 
     242         &                  ln_usecplmask, ln_coupled_iceshelf_fluxes, ln_iceshelf_init_atmos,        & 
     243         &                  rn_greenland_calving_fraction, & 
    243244         &                  rn_antarctica_calving_fraction, rn_iceshelf_fluxes_tolerance 
    244245      !!--------------------------------------------------------------------- 
     
    311312         WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask 
    312313         WRITE(numout,*)'  ln_coupled_iceshelf_fluxes          = ', ln_coupled_iceshelf_fluxes 
     314         WRITE(numout,*)'  ln_iceshelf_init_atmos              = ', ln_iceshelf_init_atmos 
    313315         WRITE(numout,*)'  rn_greenland_calving_fraction       = ', rn_greenland_calving_fraction 
    314316         WRITE(numout,*)'  rn_antarctica_calving_fraction      = ', rn_antarctica_calving_fraction 
     
    13441346         greenland_icesheet_mass_array(:,:) = frcv(jpr_grnm)%z3(:,:,1) 
    13451347         ! take average over ocean points of input array to avoid cumulative error over time 
    1346  
    13471348         ! The following must be bit reproducible over different PE decompositions 
    13481349         zgreenland_icesheet_mass_in = glob_sum( greenland_icesheet_mass_array(:,:) * tmask(:,:,1) ) 
     
    13501351         zgreenland_icesheet_mass_in = zgreenland_icesheet_mass_in / zmask_sum 
    13511352         greenland_icesheet_timelapsed = greenland_icesheet_timelapsed + rdt          
     1353 
     1354         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN 
     1355            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart 
     1356            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts. 
     1357            zgreenland_icesheet_mass_b = zgreenland_icesheet_mass_in 
     1358            greenland_icesheet_mass = zgreenland_icesheet_mass_in 
     1359         ENDIF 
     1360 
    13521361         IF( ABS( zgreenland_icesheet_mass_in - greenland_icesheet_mass ) > zepsilon ) THEN 
    13531362            zgreenland_icesheet_mass_b = greenland_icesheet_mass 
    13541363             
    1355             ! Only update the mass if it has increased 
     1364            ! Only update the mass if it has increased. 
    13561365            IF ( (zgreenland_icesheet_mass_in - greenland_icesheet_mass) > 0.0 ) THEN 
    13571366               greenland_icesheet_mass = zgreenland_icesheet_mass_in 
     
    13771386         zantarctica_icesheet_mass_in = zantarctica_icesheet_mass_in / zmask_sum 
    13781387         antarctica_icesheet_timelapsed = antarctica_icesheet_timelapsed + rdt          
     1388 
     1389         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN 
     1390            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart 
     1391            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts. 
     1392            zantarctica_icesheet_mass_b = zantarctica_icesheet_mass_in 
     1393            antarctica_icesheet_mass = zantarctica_icesheet_mass_in 
     1394         ENDIF 
     1395 
    13791396         IF( ABS( zantarctica_icesheet_mass_in - antarctica_icesheet_mass ) > zepsilon ) THEN 
    13801397            zantarctica_icesheet_mass_b = antarctica_icesheet_mass 
    13811398             
    1382             ! Only update the mass if it has increased 
     1399            ! Only update the mass if it has increased. 
    13831400            IF ( (zantarctica_icesheet_mass_in - antarctica_icesheet_mass) > 0.0 ) THEN 
    13841401               antarctica_icesheet_mass = zantarctica_icesheet_mass_in 
     
    17281745         zemp_ice(:,:) = ( frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) ) * zicefr(:,:) 
    17291746#endif                   
    1730             CALL iom_put( 'rain'         , frcv(jpr_rain)%z3(:,:,1)              )   ! liquid precipitation  
     1747         CALL iom_put( 'rain'         , frcv(jpr_rain)%z3(:,:,1) * tmask(:,:,1)      )   ! liquid precipitation  
     1748         CALL iom_put( 'rain_ao_cea'  , frcv(jpr_rain)%z3(:,:,1)* p_frld(:,:) * tmask(:,:,1)      )   ! liquid precipitation  
    17311749         IF( iom_use('hflx_rain_cea') )   & 
    1732             &  CALL iom_put( 'hflx_rain_cea',   frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:)                                            )  ! heat flux from liq. precip.  
     1750            &  CALL iom_put( 'hflx_rain_cea', frcv(jpr_rain)%z3(:,:,1) * zcptn(:,:) * tmask(:,:,1))   ! heat flux from liq. precip.  
     1751         IF( iom_use('hflx_prec_cea') )   & 
     1752            & CALL iom_put( 'hflx_prec_cea', ztprecip * zcptn(:,:) * tmask(:,:,1) * p_frld(:,:) )   ! heat content flux from all precip  (cell avg) 
     1753         IF( iom_use('evap_ao_cea') .OR. iom_use('hflx_evap_cea') )   & 
     1754            & ztmp(:,:) = frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) 
    17331755         IF( iom_use('evap_ao_cea'  ) )   & 
    1734             &  CALL iom_put( 'evap_ao_cea'  ,   frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:)                )  ! ice-free oce evap (cell average) 
     1756            &  CALL iom_put( 'evap_ao_cea'  , ztmp * tmask(:,:,1)                  )   ! ice-free oce evap (cell average) 
    17351757         IF( iom_use('hflx_evap_cea') )   & 
    1736             &  CALL iom_put( 'hflx_evap_cea', ( frcv(jpr_tevp)%z3(:,:,1) - frcv(jpr_ievp)%z3(:,:,1) * zicefr(:,:) ) * zcptn(:,:) )  ! heat flux from from evap (cell average) 
     1758            &  CALL iom_put( 'hflx_evap_cea', ztmp(:,:) * zcptn(:,:) * tmask(:,:,1) )   ! heat flux from from evap (cell average) 
    17371759      CASE( 'oce and ice' )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    17381760         zemp_tot(:,:) = p_frld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + zicefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     
    17981820      ! runoffs and calving (put in emp_tot) 
    17991821      IF( srcv(jpr_rnf)%laction )   rnf(:,:) = frcv(jpr_rnf)%z3(:,:,1) 
     1822      IF( iom_use('hflx_rnf_cea') )   & 
     1823         CALL iom_put( 'hflx_rnf_cea' , rnf(:,:) * zcptn(:,:) ) 
    18001824      IF( srcv(jpr_cal)%laction ) THEN  
    18011825         zemp_tot(:,:) = zemp_tot(:,:) - frcv(jpr_cal)%z3(:,:,1) 
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90

    r6755 r7923  
    9191    CHARACTER (LEN=32)           :: cvarLeff                    ! variable name for efficient Length scale 
    9292    INTEGER           ::   ios           ! Local integer output status for namelist read 
     93 
     94    REAL(wp), DIMENSION(:,:,:), POINTER :: zfwfisf3d, zqhcisf3d, zqlatisf3d 
     95    REAL(wp), DIMENSION(:,:  ), POINTER :: zqhcisf2d 
    9396      ! 
    9497      !!--------------------------------------------------------------------- 
     
    355358 
    356359         ! output 
    357          IF( iom_use('qisf'  ) )   CALL iom_put('qisf'  , qisf) 
    358          IF( iom_use('fwfisf') )   CALL iom_put('fwfisf', fwfisf * stbl(:,:) / soce ) 
     360         IF( iom_use('qlatisf' ) )   CALL iom_put('qlatisf', qisf) 
     361         IF( iom_use('fwfisf'  ) )   CALL iom_put('fwfisf' , fwfisf * stbl(:,:) / soce ) 
    359362 
    360363         ! if apply only on the trend and not as a volume flux (rdivisf = 0), fwfisf have to be set to 0 now 
     
    366369         CALL lbc_lnk(fwfisf(:,:)   ,'T',1.) 
    367370         CALL lbc_lnk(qisf(:,:)     ,'T',1.) 
     371 
     372!============================================================================================================================================= 
     373         IF ( iom_use('fwfisf3d') .OR. iom_use('qlatisf3d') .OR. iom_use('qhcisf3d') .OR. iom_use('qhcisf')) THEN 
     374            CALL wrk_alloc( jpi,jpj,jpk, zfwfisf3d, zqhcisf3d, zqlatisf3d ) 
     375            CALL wrk_alloc( jpi,jpj,     zqhcisf2d                        ) 
     376 
     377            zfwfisf3d(:,:,:) = 0.0_wp                         ! 3d ice shelf melting (kg/m2/s) 
     378            zqhcisf3d(:,:,:) = 0.0_wp                         ! 3d heat content flux (W/m2) 
     379            zqlatisf3d(:,:,:)= 0.0_wp                         ! 3d ice shelf melting latent heat flux (W/m2) 
     380            zqhcisf2d(:,:)   = fwfisf(:,:) * zt_frz * rcp     ! 2d heat content flux (W/m2) 
     381 
     382            DO jj = 1,jpj 
     383               DO ji = 1,jpi 
     384                  ikt = misfkt(ji,jj) 
     385                  ikb = misfkb(ji,jj) 
     386                  DO jk = ikt, ikb - 1 
     387                     zfwfisf3d (ji,jj,jk) = zfwfisf3d (ji,jj,jk) + fwfisf   (ji,jj) * r1_hisf_tbl(ji,jj) * fse3t(ji,jj,jk) 
     388                     zqhcisf3d (ji,jj,jk) = zqhcisf3d (ji,jj,jk) + zqhcisf2d(ji,jj) * r1_hisf_tbl(ji,jj) * fse3t(ji,jj,jk) 
     389                     zqlatisf3d(ji,jj,jk) = zqlatisf3d(ji,jj,jk) + qisf     (ji,jj) * r1_hisf_tbl(ji,jj) * fse3t(ji,jj,jk) 
     390                  END DO 
     391                  zfwfisf3d (ji,jj,jk) = zfwfisf3d (ji,jj,jk) + fwfisf   (ji,jj) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) * fse3t(ji,jj,jk) 
     392                  zqhcisf3d (ji,jj,jk) = zqhcisf3d (ji,jj,jk) + zqhcisf2d(ji,jj) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) * fse3t(ji,jj,jk) 
     393                  zqlatisf3d(ji,jj,jk) = zqlatisf3d(ji,jj,jk) + qisf     (ji,jj) * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) * fse3t(ji,jj,jk) 
     394               END DO 
     395            END DO 
     396 
     397            CALL iom_put('fwfisf3d' , zfwfisf3d (:,:,:)) 
     398            CALL iom_put('qlatisf3d', zqlatisf3d(:,:,:)) 
     399            CALL iom_put('qhcisf3d' , zqhcisf3d (:,:,:)) 
     400            CALL iom_put('qhcisf'   , zqhcisf2d (:,:  )) 
     401 
     402            CALL wrk_dealloc( jpi,jpj,jpk, zfwfisf3d, zqhcisf3d, zqlatisf3d ) 
     403            CALL wrk_dealloc( jpi,jpj,     zqhcisf2d                        ) 
     404         END IF 
     405!============================================================================================================================================= 
    368406 
    369407         IF( kt == nit000 ) THEN                          !   set the forcing field at nit000 - 1    ! 
Note: See TracChangeset for help on using the changeset viewer.