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 2068 for branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2010-09-06T17:56:51+02:00 (14 years ago)
Author:
mlelod
Message:

ticket: #663 ensuring restartability and conservation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA/trasbc.F90

    r1975 r2068  
    2020   USE trdmod          ! ocean trends  
    2121   USE trdmod_oce      ! ocean variables trends 
     22   USE iom 
    2223   USE in_out_manager  ! I/O manager 
     24   USE restart         ! ocean restart 
    2325   USE prtctl          ! Print control 
    2426 
     
    132134         ENDIF 
    133135      ENDIF 
    134  
    135       !                             ! ---------------------- ! 
    136       IF( lk_vvl ) THEN             !  Variable Volume case  ! 
    137          !                          ! ---------------------- ! 
     136      !                                            ! ---------------------------------------- ! 
     137      IF( kt /= nit000 ) THEN                      !          Swap of forcing fields          ! 
     138         !                                         ! ---------------------------------------- ! 
     139         sbc_trd_hc_b(:,:) = sbc_trd_hc_n(:,:)                         ! Swap the ocean forcing fields except at nit000 
     140         IF ( .NOT. lk_vvl ) sbc_trd_sc_b(:,:)   = sbc_trd_sc_n(:,:) 
     141      ENDIF 
     142      !                                            ! ---------------------------------------- ! 
     143      IF( kt == nit000 ) THEN                      !   set the forcing field at nit000 - 1    ! 
     144         !                                         ! ---------------------------------------- ! 
     145         IF( ln_rstart .AND.    &                               !* Restart: read in restart file 
     146            & iom_varid( numror, 'sbc_trd_hc_b', ldstop = .FALSE. ) > 0 ) THEN  
     147            IF(lwp) WRITE(numout,*) '          nit000-1 surface forcing fields red in the restart file' 
     148            CALL iom_get( numror, jpdom_autoglo, 'sbc_trd_hc_b', sbc_trd_hc_b )   ! before heat content sbc trend 
     149            CALL iom_get( numror, jpdom_autoglo, 'qsr_trd_hc_b', qsr_trd_hc_b )   ! before heat content trend due to Qsr flux 
     150            IF ( .NOT. lk_vvl ) THEN 
     151               CALL iom_get( numror, jpdom_autoglo, 'sbc_trd_sc_b', sbc_trd_sc_b )   ! before salt content sbc trend 
     152            ENDIF 
     153         ENDIF 
     154      ENDIF 
     155      !                                            ! ---------------------- ! 
     156      IF( lk_vvl ) THEN                            !  Variable Volume case  ! 
     157         !                                         ! ---------------------- ! 
    138158!!gm BUG : in key_vvl emps must be modified to only include the salt flux due to sea-ice freezing/melting 
    139159!!gm       otherwise this flux will be missing  ==> modification required in limsbc,  limsbc_2 and CICE interface.s 
     
    161181            END DO 
    162182         ENDIF 
    163          !                          ! ---------------------- ! 
    164       ELSE                          !  Constant Volume case  ! 
    165          !                          ! ---------------------- ! 
     183         !                                         ! ---------------------- ! 
     184      ELSE                                         !  Constant Volume case  ! 
     185         !                                         ! ---------------------- ! 
    166186         IF ( neuler == 0 .AND. kt == nit000 ) THEN 
    167187            DO jj = 2, jpj 
     
    197217      ENDIF 
    198218 
     219      !                                            ! ---------------------------------------- ! 
     220      IF( lrst_oce ) THEN                          !      Write in the ocean restart file     ! 
     221         !                                         ! ---------------------------------------- ! 
     222         IF(lwp) WRITE(numout,*) 
     223         IF(lwp) WRITE(numout,*) 'sbc : ocean surface forcing fields written in ocean restart file ',   & 
     224            &                    'at it= ', kt,' date= ', ndastp 
     225         IF(lwp) WRITE(numout,*) '~~~~' 
     226         CALL iom_rstput( kt, nitrst, numrow, 'sbc_trd_hc_b', sbc_trd_hc_n ) 
     227         IF ( .NOT. lk_vvl ) CALL iom_rstput( kt, nitrst, numrow, 'sbc_trd_sc_b', sbc_trd_sc_n ) 
     228         ! 
     229      ENDIF 
     230 
    199231      IF( l_trdtra ) THEN           ! save the sbc trends for diagnostic 
    200232         ztrdt(:,:,:) = ta(:,:,:) - ztrdt(:,:,:) 
     
    205237      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ta, clinfo1=' sbc  - Ta: ', mask1=tmask,   & 
    206238         &                       tab3d_2=sa, clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    207       ! 
    208239   END SUBROUTINE tra_sbc 
    209240 
Note: See TracChangeset for help on using the changeset viewer.