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 7788 for trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90 – NEMO

Ignore:
Timestamp:
2017-03-11T10:40:59+01:00 (7 years ago)
Author:
cetlod
Message:

trunk : representation of ice shelf melting in coupled mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90

    r7646 r7788  
    5151   REAL(wp)   , PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)     ::  ttbl, stbl, utbl, vtbl !:top boundary layer variable at T point 
    5252   INTEGER,    PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)      ::  misfkt, misfkb         !:Level of ice shelf base 
     53 
     54   LOGICAL, PUBLIC ::   l_isfcpl = .false.       ! isf recieved from oasis 
    5355 
    5456   REAL(wp), PUBLIC, SAVE ::   rcpi     = 2000.0_wp     ! specific heat of ice shelf             [J/kg/K] 
     
    9799      !!--------------------------------------------------------------------- 
    98100      ! 
    99       !                                         ! ====================== ! 
    100       IF( kt == nit000 ) THEN                   !  First call kt=nit000  ! 
    101          !                                      ! ====================== ! 
    102          CALL sbc_isf_init 
    103       !                                         ! ---------------------------------------- ! 
    104       ELSE                                      !          Swap of forcing fields          ! 
    105          !                                      ! ---------------------------------------- ! 
    106          fwfisf_b  (:,:  ) = fwfisf  (:,:  )    ! Swap the ocean forcing fields except at nit000 
    107          risf_tsc_b(:,:,:) = risf_tsc(:,:,:)    ! where before fields are set at the end of the routine 
    108          ! 
    109       END IF 
    110  
    111101      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN 
    112102         ! allocation 
     
    127117            CALL iom_put('vtbl',vtbl(:,:) * (1._wp - tmask(:,:,1)) * ssmask(:,:)) 
    128118            ! compute fwf and heat flux 
    129             CALL sbc_isf_cav (kt) 
     119            ! compute fwf and heat flux 
     120            IF( .NOT.l_isfcpl ) THEN    ;   CALL sbc_isf_cav (kt) 
     121            ELSE                        ;   qisf(:,:)  = fwfisf(:,:) * rlfusisf  ! heat        flux 
     122            ENDIF 
    130123 
    131124         CASE ( 2 )    ! Beckmann and Goosse parametrisation  
     
    134127 
    135128         CASE ( 3 )    ! specified runoff in depth (Mathiot et al., XXXX in preparation) 
    136             CALL fld_read ( kt, nn_fsbc, sf_rnfisf   ) 
    137             fwfisf(:,:) = - sf_rnfisf(1)%fnow(:,:,1)         ! fwf  flux from the isf (fwfisf <0 mean melting)  
     129            ! specified runoff in depth (Mathiot et al., XXXX in preparation) 
     130            IF( .NOT.l_isfcpl ) THEN 
     131               CALL fld_read ( kt, nn_fsbc, sf_rnfisf   ) 
     132               fwfisf(:,:) = - sf_rnfisf(1)%fnow(:,:,1)         ! fresh water flux from the isf (fwfisf <0 mean melting)  
     133            ENDIF 
    138134            qisf(:,:)   = fwfisf(:,:) * rlfusisf             ! heat flux 
    139135            stbl(:,:)   = soce 
    140136 
    141137         CASE ( 4 )    ! specified fwf and heat flux forcing beneath the ice shelf 
    142             CALL fld_read ( kt, nn_fsbc, sf_fwfisf   ) 
    143             fwfisf(:,:) = - sf_fwfisf(1)%fnow(:,:,1)           ! fwf  flux from the isf (fwfisf <0 mean melting) 
     138           ! specified fwf and heat flux forcing beneath the ice shelf 
     139            IF( .NOT.l_isfcpl ) THEN 
     140               CALL fld_read ( kt, nn_fsbc, sf_fwfisf   ) 
     141               !CALL fld_read ( kt, nn_fsbc, sf_qisf   ) 
     142               fwfisf(:,:) = -sf_fwfisf(1)%fnow(:,:,1)            ! fwf 
     143            ENDIF 
    144144            qisf(:,:)   = fwfisf(:,:) * rlfusisf               ! heat flux 
    145145            stbl(:,:)   = soce 
     
    167167         CALL lbc_lnk(qisf(:,:)     ,'T',1.) 
    168168 
    169 !============================================================================================================================================= 
    170          IF ( iom_use('fwfisf3d') .OR. iom_use('qlatisf3d') .OR. iom_use('qhcisf3d') .OR. iom_use('qhcisf')) THEN 
     169         ! output 
     170         CALL iom_put('qlatisf' , qisf) 
     171         CALL iom_put('fwfisf'  , fwfisf) 
     172 
     173        ! Diagnostics 
     174        IF ( iom_use('fwfisf3d') .OR. iom_use('qlatisf3d') .OR. iom_use('qhcisf3d') .OR. iom_use('qhcisf')) THEN 
    171175            CALL wrk_alloc( jpi,jpj,jpk, zfwfisf3d, zqhcisf3d, zqlatisf3d ) 
    172176            CALL wrk_alloc( jpi,jpj,     zqhcisf2d                        ) 
     
    199203            CALL wrk_dealloc( jpi,jpj,jpk, zfwfisf3d, zqhcisf3d, zqlatisf3d ) 
    200204            CALL wrk_dealloc( jpi,jpj,     zqhcisf2d                        ) 
    201          END IF 
    202  
    203          ! output 
    204          CALL iom_put('qlatisf'  , qisf) 
    205          CALL iom_put('fwfisf', fwfisf) 
    206 !============================================================================================================================================= 
    207  
    208          IF( kt == nit000 ) THEN                         !   set the forcing field at nit000 - 1    ! 
    209             IF( ln_rstart .AND.    &                     ! Restart: read in restart file 
     205          END IF 
     206          ! deallocation 
     207          CALL wrk_dealloc( jpi,jpj, zt_frz, zdep  ) 
     208          ! 
     209        END IF 
     210 
     211        IF( kt == nit000 ) THEN                         !   set the forcing field at nit000 - 1    ! 
     212           IF( ln_rstart .AND.    &                     ! Restart: read in restart file 
    210213                 & iom_varid( numror, 'fwf_isf_b', ldstop = .FALSE. ) > 0 ) THEN 
    211214               IF(lwp) WRITE(numout,*) '          nit000-1 isf tracer content forcing fields read in the restart file' 
     
    213216               CALL iom_get( numror, jpdom_autoglo, 'isf_sc_b', risf_tsc_b(:,:,jp_sal) )   ! before salt content isf_tsc trend 
    214217               CALL iom_get( numror, jpdom_autoglo, 'isf_hc_b', risf_tsc_b(:,:,jp_tem) )   ! before salt content isf_tsc trend 
    215             ELSE 
     218           ELSE 
    216219               fwfisf_b(:,:)    = fwfisf(:,:) 
    217220               risf_tsc_b(:,:,:)= risf_tsc(:,:,:) 
    218             END IF 
     221           END IF 
    219222         END IF 
    220223         !  
    221          ! deallocation 
    222          CALL wrk_dealloc( jpi,jpj, zt_frz, zdep  ) 
    223       END IF 
    224       !   
     224         IF( lrst_oce ) THEN 
     225            IF(lwp) WRITE(numout,*) 
     226            IF(lwp) WRITE(numout,*) 'sbc : isf surface tracer content forcing fields written in ocean restart file ',   & 
     227               &                    'at it= ', kt,' date= ', ndastp 
     228            IF(lwp) WRITE(numout,*) '~~~~' 
     229            CALL iom_rstput( kt, nitrst, numrow, 'fwf_isf_b', fwfisf(:,:) ) 
     230            CALL iom_rstput( kt, nitrst, numrow, 'isf_hc_b' , risf_tsc(:,:,jp_tem) ) 
     231            CALL iom_rstput( kt, nitrst, numrow, 'isf_sc_b' , risf_tsc(:,:,jp_sal) ) 
     232         ENDIF 
     233         ! 
    225234  END SUBROUTINE sbc_isf 
    226235 
     
    306315 
    307316      CASE ( 2 , 3 ) 
    308          ALLOCATE( sf_rnfisf(1), STAT=ierror ) 
    309          ALLOCATE( sf_rnfisf(1)%fnow(jpi,jpj,1), sf_rnfisf(1)%fdta(jpi,jpj,1,2) ) 
    310          CALL fld_fill( sf_rnfisf, (/ sn_rnfisf /), cn_dirisf, 'sbc_isf_init', 'read fresh water flux isf data', 'namsbc_isf' ) 
    311  
    312          !  read effective lenght (BG03) 
    313          IF (nn_isf == 2) THEN 
     317         IF( .NOT.l_isfcpl ) THEN 
     318             ALLOCATE( sf_rnfisf(1), STAT=ierror ) 
     319             ALLOCATE( sf_rnfisf(1)%fnow(jpi,jpj,1), sf_rnfisf(1)%fdta(jpi,jpj,1,2) ) 
     320             CALL fld_fill( sf_rnfisf, (/ sn_rnfisf /), cn_dirisf, 'sbc_isf_init', 'read fresh water flux isf data', 'namsbc_isf' ) 
     321          ENDIF 
     322          !  read effective lenght (BG03) 
     323          IF (nn_isf == 2) THEN 
    314324            CALL iom_open( sn_Leff_isf%clname, inum ) 
    315325            cvarLeff = TRIM(sn_Leff_isf%clvar) 
     
    318328            ! 
    319329            risfLeff = risfLeff*1000.0_wp           !: convertion in m 
    320          END IF 
    321  
     330          END IF 
    322331         ! read depth of the top and bottom of the isf top boundary layer (in this case, isf front depth and grounding line depth) 
    323332         CALL iom_open( sn_depmax_isf%clname, inum ) 
     
    348357          
    349358         ! load variable used in fldread (use for temporal interpolation of isf fwf forcing) 
    350          ALLOCATE( sf_fwfisf(1), STAT=ierror ) 
    351          ALLOCATE( sf_fwfisf(1)%fnow(jpi,jpj,1), sf_fwfisf(1)%fdta(jpi,jpj,1,2) ) 
    352          CALL fld_fill( sf_fwfisf, (/ sn_fwfisf /), cn_dirisf, 'sbc_isf_init', 'read fresh water flux isf data', 'namsbc_isf' ) 
     359         IF( .NOT.l_isfcpl ) THEN 
     360           ALLOCATE( sf_fwfisf(1), STAT=ierror ) 
     361           ALLOCATE( sf_fwfisf(1)%fnow(jpi,jpj,1), sf_fwfisf(1)%fdta(jpi,jpj,1,2) ) 
     362           CALL fld_fill( sf_fwfisf, (/ sn_fwfisf /), cn_dirisf, 'sbc_isf_init', 'read fresh water flux isf data', 'namsbc_isf' ) 
     363         ENDIF 
    353364 
    354365      END SELECT 
Note: See TracChangeset for help on using the changeset viewer.