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 8817 for branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/LIM_SRC_3/icerst.F90 – NEMO

Ignore:
Timestamp:
2017-11-27T12:03:07+01:00 (6 years ago)
Author:
clem
Message:

make ice restart file shorter (this commit is on behalf of Madec)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7881_ENHANCE09_RK3/NEMOGCM/NEMO/LIM_SRC_3/icerst.F90

    r8637 r8817  
    66   !! History:   3.0  ! 2005-04 (M. Vancoppenolle) Original code 
    77   !!             -   ! 2008-03 (C. Ethe) restart files in using IOM interface 
    8    !!            4.0  ! 2011-02 (G. Madec) dynamical allocation 
     8   !!            3.4  ! 2011-02 (G. Madec) dynamical allocation 
     9   !!            4.0  ! 2017-11 (M. Andrejczuk) Extend IOM interface to write 3D ice fields 
    910   !!---------------------------------------------------------------------- 
    1011#if defined key_lim3 
     
    8283            ENDIF 
    8384            ! 
    84             CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
     85            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib, kdlev = jpl ) 
    8586            lrst_ice = .TRUE. 
    8687         ENDIF 
     
    8889      ! 
    8990      IF( ln_icectl )   CALL ice_prt( kt, iiceprt, jiceprt, 1, ' - Beginning the time step - ' )   ! control print 
     91      ! 
    9092   END SUBROUTINE ice_rst_opn 
    9193 
     
    103105      CHARACTER(len=25) ::   znam 
    104106      CHARACTER(len=2)  ::   zchar, zchar1 
    105       REAL(wp), DIMENSION(jpi,jpj) :: z2d 
     107      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z3d   ! 3D workspace 
    106108      !!---------------------------------------------------------------------- 
    107109 
     
    120122      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date 
    121123 
    122 !!gm   It is possible and easy to define a 3D domain size (jpi,jpj,jpl) or use a SIZE( tab, DIM=3) in iom_rtput ) 
    123 !!gm         ===>>> just a simple   iom_rstput( iter, nitrst, numriw, 'v_i', v_i )  etc... 
    124 !!gm   "just" ask Sebatien 
    125  
    126       ! Prognostic variables  
    127       DO jl = 1, jpl  
    128          WRITE(zchar,'(I2.2)') jl 
    129          znam = 'v_i'//'_htc'//zchar 
    130          z2d(:,:) = v_i(:,:,jl) 
    131          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! v_i 
    132          znam = 'v_s'//'_htc'//zchar 
    133          z2d(:,:) = v_s(:,:,jl) 
    134          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! v_s 
    135          znam = 'sv_i'//'_htc'//zchar 
    136          z2d(:,:) = sv_i(:,:,jl) 
    137          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! sv_i 
    138          znam = 'oa_i'//'_htc'//zchar 
    139          z2d(:,:) = oa_i(:,:,jl) 
    140          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! oa_i 
    141          znam = 'a_i'//'_htc'//zchar 
    142          z2d(:,:) = a_i(:,:,jl) 
    143          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! a_i 
    144          znam = 't_su'//'_htc'//zchar 
    145          z2d(:,:) = t_su(:,:,jl) 
    146          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! t_su 
     124      ! Prognostic variables 
     125      CALL iom_rstput( iter, nitrst, numriw, 'v_i' , v_i  ) 
     126      CALL iom_rstput( iter, nitrst, numriw, 'v_s' , v_s  ) 
     127      CALL iom_rstput( iter, nitrst, numriw, 'sv_i', sv_i ) 
     128      CALL iom_rstput( iter, nitrst, numriw, 'oa_i', oa_i ) 
     129      CALL iom_rstput( iter, nitrst, numriw, 'a_i' , a_i  ) 
     130      CALL iom_rstput( iter, nitrst, numriw, 't_su', t_su ) 
     131      ! 
     132      ! Melt ponds 
     133      CALL iom_rstput( iter, nitrst, numriw, 'a_ip', a_ip ) 
     134      CALL iom_rstput( iter, nitrst, numriw, 'v_ip', v_ip ) 
     135      ! 
     136!!gm dangerous !!!!!  ===>>>> better reading writing all snow layers ! 
     137      ! Snow enthalpy (1st snow layer only) 
     138      z3d = e_s(:,:,1,:) 
     139      CALL iom_rstput( iter, nitrst, numriw, 'tempt_sl1' , z3d ) 
     140      ! 
     141      ! Ice enthalpy (all ice layers) 
     142      DO jk = 1, nlay_i  
     143         WRITE(zchar1,'(I2.2)') jk 
     144         znam = 'tempt'//'_il'//zchar1 
     145         z3d(:,:,:) = e_i(:,:,jk,:) 
     146         CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 
    147147      END DO 
    148  
    149       DO jl = 1, jpl  
    150          WRITE(zchar,'(I2.2)') jl 
    151          znam = 'a_ip'//'_htc'//zchar 
    152          z2d(:,:) = a_ip(:,:,jl) 
    153          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! a_ip 
    154          znam = 'v_ip'//'_htc'//zchar 
    155          z2d(:,:) = v_ip(:,:,jl) 
    156          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! v_ip 
    157       END DO 
    158  
    159       DO jl = 1, jpl  
    160          WRITE(zchar,'(I2.2)') jl 
    161          znam = 'tempt_sl1'//'_htc'//zchar 
    162          z2d(:,:) = e_s(:,:,1,jl) 
    163          CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! e_s 
    164          DO jk = 1, nlay_i  
    165             WRITE(zchar1,'(I2.2)') jk 
    166             znam = 'tempt'//'_il'//zchar1//'_htc'//zchar 
    167             z2d(:,:) = e_i(:,:,jk,jl) 
    168             CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) ! e_i 
    169          END DO 
    170       END DO 
    171  
     148      ! 
     149      ! ice velocity 
    172150      CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice ) ! u_ice 
    173151      CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice ) ! v_ice 
     
    189167      !! ** purpose  :   read restart file 
    190168      !!---------------------------------------------------------------------- 
    191       INTEGER  ::   jk, jl 
    192       INTEGER  ::   id1            ! local integer 
    193       REAL(wp) ::   zfice, ziter 
    194       REAL(wp), DIMENSION(jpi,jpj) ::   z2d 
     169      INTEGER           ::   jk, jl 
     170      LOGICAL           ::   llok 
     171      INTEGER           ::   id1            ! local integer 
     172      INTEGER           ::   jlibalt = jprstlib 
    195173      CHARACTER(len=25) ::   znam 
    196174      CHARACTER(len=2)  ::   zchar, zchar1 
    197       INTEGER           ::   jlibalt = jprstlib 
    198       LOGICAL           ::   llok 
     175      REAL(wp)          ::   zfice, ziter 
     176      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z3d   ! 3D workspace 
    199177      !!---------------------------------------------------------------------- 
    200178 
     
    205183      ENDIF 
    206184 
    207       CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib ) 
     185      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib, kdlev = jpl ) 
    208186 
    209187      CALL iom_get( numrir, 'nn_fsbc', zfice ) 
     
    223201 
    224202      ! Prognostic variables  
    225       DO jl = 1, jpl  
    226          WRITE(zchar,'(I2.2)') jl 
    227          znam = 'v_i'//'_htc'//zchar 
    228          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    229          v_i(:,:,jl) = z2d(:,:) 
    230          znam = 'v_s'//'_htc'//zchar 
    231          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    232          v_s(:,:,jl) = z2d(:,:)  
    233          znam = 'sv_i'//'_htc'//zchar 
    234          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    235          sv_i(:,:,jl) = z2d(:,:) 
    236          znam = 'oa_i'//'_htc'//zchar 
    237          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    238          oa_i(:,:,jl) = z2d(:,:) 
    239          znam = 'a_i'//'_htc'//zchar 
    240          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    241          a_i(:,:,jl) = z2d(:,:) 
    242          znam = 't_su'//'_htc'//zchar 
    243          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    244          t_su(:,:,jl) = z2d(:,:) 
    245       END DO 
    246  
     203      CALL iom_get( numrir, jpdom_autoglo, 'v_i' , v_i  ) 
     204      CALL iom_get( numrir, jpdom_autoglo, 'v_s' , v_s  ) 
     205      CALL iom_get( numrir, jpdom_autoglo, 'sv_i', sv_i ) 
     206      CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i ) 
     207      CALL iom_get( numrir, jpdom_autoglo, 'a_i' , a_i  ) 
     208      CALL iom_get( numrir, jpdom_autoglo, 't_su', t_su ) 
     209      ! 
     210      ! Melt ponds 
    247211      id1 = iom_varid( numrir, 'a_ip_htc01' , ldstop = .FALSE. ) 
    248212      IF( id1 > 0 ) THEN                       ! fields exist (melt ponds) 
    249          DO jl = 1, jpl  
    250             WRITE(zchar,'(I2.2)') jl 
    251             znam = 'a_ip'//'_htc'//zchar 
    252             CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    253             a_ip(:,:,jl) = z2d(:,:) 
    254             znam = 'v_ip'//'_htc'//zchar 
    255             CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    256             v_ip(:,:,jl) = z2d(:,:) 
    257          END DO 
     213         CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip ) 
     214         CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip ) 
    258215      ELSE                                     ! start from rest 
    259          IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it' 
     216         IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero' 
    260217         a_ip(:,:,:) = 0._wp 
    261218         v_ip(:,:,:) = 0._wp 
    262219      ENDIF 
    263  
    264       DO jl = 1, jpl  
    265          WRITE(zchar,'(I2.2)') jl 
    266          znam = 'tempt_sl1'//'_htc'//zchar 
    267          CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    268          e_s(:,:,1,jl) = z2d(:,:) 
    269          DO jk = 1, nlay_i  
    270             WRITE(zchar1,'(I2.2)') jk 
    271             znam = 'tempt'//'_il'//zchar1//'_htc'//zchar 
    272             CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) 
    273             e_i(:,:,jk,jl) = z2d(:,:) 
    274          END DO 
     220      ! 
     221!!gm dangerous !!!!!  ===>>>> better reading writing all snow layers ! 
     222      ! Snow enthalpy (1st snow layer only) 
     223      CALL iom_get( numrir, jpdom_autoglo, 'tempt_sl1' , z3d ) 
     224      e_s(:,:,1,:) = z3d 
     225      ! 
     226      ! Ice enthalpy (all ice layers) 
     227      DO jk = 1, nlay_i  
     228         WRITE(zchar1,'(I2.2)') jk 
     229         znam = 'tempt'//'_il'//zchar1 
     230         CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
     231         e_i(:,:,jk,:) = z3d(:,:,:) 
    275232      END DO 
    276  
     233      ! 
     234      ! ice velocity 
    277235      CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice ) 
    278236      CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice ) 
Note: See TracChangeset for help on using the changeset viewer.