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 9987 for branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2018-07-23T11:33:03+02:00 (6 years ago)
Author:
emmafiedler
Message:

Merge with GO6 FOAMv14 package branch r9288

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r7960 r9987  
    2121   USE in_out_manager  ! I/O manager 
    2222   USE iom             ! I/O module 
     23   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2324   USE eosbn2          ! equation of state            (eos bn2 routine) 
    2425   USE trdmxl_oce      ! ocean active mixed layer tracers trends variables 
    2526   USE divcur          ! hor. divergence and curl      (div & cur routines) 
     27   USE sbc_oce         ! for icesheet freshwater input variables 
    2628 
    2729   IMPLICIT NONE 
     
    5456      !!---------------------------------------------------------------------- 
    5557      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
     58      INTEGER             ::   iyear, imonth, iday 
     59      REAL (wp)           ::   zsec 
     60      REAL (wp)           ::   zfjulday 
    5661      !! 
    5762      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    5863      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
    59       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file 
     64      CHARACTER(LEN=150)  ::   clpath   ! full path to ocean output restart file 
    6065      !!---------------------------------------------------------------------- 
    6166      ! 
     
    8186      IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 
    8287         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    83             ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    84             IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    85             ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     88            IF ( ln_rstdate ) THEN 
     89               zfjulday = fjulday + rdttra(1) / rday 
     90               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     91               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     92               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     93            ELSE 
     94               ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     95               IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     96               ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     97               ENDIF 
    8698            ENDIF 
    8799            ! create the file 
     
    145157                     CALL iom_rstput( kt, nitrst, numrow, 'rhd'    , rhd       ) 
    146158#endif 
     159                     IF( lk_oasis) THEN 
     160                     ! nn_coupled_iceshelf_fluxes uninitialised unless lk_oasis=true 
     161                     IF( nn_coupled_iceshelf_fluxes .eq. 1 ) THEN 
     162                        CALL iom_rstput( kt, nitrst, numrow, 'greenland_icesheet_mass', greenland_icesheet_mass ) 
     163                        CALL iom_rstput( kt, nitrst, numrow, 'greenland_icesheet_timelapsed', greenland_icesheet_timelapsed ) 
     164                        CALL iom_rstput( kt, nitrst, numrow, 'greenland_icesheet_mass_roc', greenland_icesheet_mass_rate_of_change ) 
     165                        CALL iom_rstput( kt, nitrst, numrow, 'antarctica_icesheet_mass', antarctica_icesheet_mass ) 
     166                        CALL iom_rstput( kt, nitrst, numrow, 'antarctica_icesheet_timelapsed', antarctica_icesheet_timelapsed ) 
     167                        CALL iom_rstput( kt, nitrst, numrow, 'antarctica_icesheet_mass_roc', antarctica_icesheet_mass_rate_of_change ) 
     168                     ENDIF 
     169                     ENDIF 
     170 
    147171      IF( kt == nitrst ) THEN 
    148172         CALL iom_close( numrow )     ! close the restart file (only at last time step) 
     
    258282#endif 
    259283      ! 
     284      IF( iom_varid( numror, 'greenland_icesheet_mass', ldstop = .FALSE. ) > 0 )   THEN 
     285         CALL iom_get( numror, 'greenland_icesheet_mass', greenland_icesheet_mass ) 
     286         CALL iom_get( numror, 'greenland_icesheet_timelapsed', greenland_icesheet_timelapsed ) 
     287         CALL iom_get( numror, 'greenland_icesheet_mass_roc', greenland_icesheet_mass_rate_of_change ) 
     288      ELSE 
     289         greenland_icesheet_mass = 0.0  
     290         greenland_icesheet_mass_rate_of_change = 0.0  
     291         greenland_icesheet_timelapsed = 0.0 
     292      ENDIF 
     293      IF( iom_varid( numror, 'antarctica_icesheet_mass', ldstop = .FALSE. ) > 0 )   THEN 
     294         CALL iom_get( numror, 'antarctica_icesheet_mass', antarctica_icesheet_mass ) 
     295         CALL iom_get( numror, 'antarctica_icesheet_timelapsed', antarctica_icesheet_timelapsed ) 
     296         CALL iom_get( numror, 'antarctica_icesheet_mass_roc', antarctica_icesheet_mass_rate_of_change ) 
     297      ELSE 
     298         antarctica_icesheet_mass = 0.0  
     299         antarctica_icesheet_mass_rate_of_change = 0.0  
     300         antarctica_icesheet_timelapsed = 0.0 
     301      ENDIF 
     302 
    260303      IF( neuler == 0 ) THEN                                  ! Euler restart (neuler=0) 
    261304         tsb  (:,:,:,:) = tsn  (:,:,:,:)                             ! all before fields set to now values 
Note: See TracChangeset for help on using the changeset viewer.