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 11401 – NEMO

Changeset 11401


Ignore:
Timestamp:
2019-08-05T14:36:23+02:00 (5 years ago)
Author:
clem
Message:

add new functionality for initialization. Now you can use a simplified restart for starting a simulation (as for the initialization)

Location:
NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/cfgs/SHARED/namelist_ice_ref

    r11397 r11401  
    188188   ln_iceini        = .true.          !  activate ice initialization (T) or not (F) 
    189189   ln_iceini_file   = .false.         !  netcdf file provided for initialization (T) or not (F) 
    190    rn_thres_sst     =   2.0           !  max delta temp. above Tfreeze with initial ice = (sst - tfreeze) 
    191    rn_hts_ini_n     =   0.3           !  initial real snow thickness (m), North 
     190   rn_thres_sst     =   2.0           !  max temp. above Tfreeze with initial ice = (sst - tfreeze) 
     191   rn_hti_ini_n     =   3.0           !  initial ice thickness       (m), North 
     192   rn_hti_ini_s     =   1.0           !        "            "             South 
     193   rn_hts_ini_n     =   0.3           !  initial snow thickness      (m), North 
    192194   rn_hts_ini_s     =   0.3           !        "            "             South 
    193    rn_hti_ini_n     =   3.0           !  initial real ice thickness  (m), North 
    194    rn_hti_ini_s     =   1.0           !        "            "             South 
    195195   rn_ati_ini_n     =   0.9           !  initial ice concentration   (-), North 
    196196   rn_ati_ini_s     =   0.9           !        "            "             South 
     
    199199   rn_tmi_ini_n     = 270.            !  initial ice temperature     (K), North 
    200200   rn_tmi_ini_s     = 270.            !        "            "             South 
     201   rn_tsu_ini_n     = 270.            !  initial surface temperature (K), North 
     202   rn_tsu_ini_s     = 270.            !        "            "             South 
    201203   rn_tms_ini_n     = 270.            !  initial snw temperature     (K), North 
    202204   rn_tms_ini_s     = 270.            !        "            "             South 
     
    205207   rn_hpd_ini_n     =   0.05          !  initial pond depth          (m), North 
    206208   rn_hpd_ini_s     =   0.05          !        "            "             South 
    207  
     209   !        ! if ln_iceini_file=T 
    208210   sn_hti = 'Ice_initialization'    , -12 ,'hti'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    209211   sn_hts = 'Ice_initialization'    , -12 ,'hts'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    210212   sn_ati = 'Ice_initialization'    , -12 ,'ati'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     213   sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     214   sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    211215   sn_tsu = 'Ice_initialization'    , -12 ,'tsu'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    212    sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    213    sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    214216   sn_tms = 'NOT USED'              , -12 ,'tms'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    215217   sn_apd = 'NOT USED'              , -12 ,'apd'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/doc/namelists/namini

    r11397 r11401  
    44   ln_iceini        = .true.          !  activate ice initialization (T) or not (F) 
    55   ln_iceini_file   = .false.         !  netcdf file provided for initialization (T) or not (F) 
    6    rn_thres_sst     =   2.0           !  max delta temp. above Tfreeze with initial ice = (sst - tfreeze) 
    7    rn_hts_ini_n     =   0.3           !  initial real snow thickness (m), North 
     6   rn_thres_sst     =   2.0           !  max temp. above Tfreeze with initial ice = (sst - tfreeze) 
     7   rn_hti_ini_n     =   3.0           !  initial ice thickness       (m), North 
     8   rn_hti_ini_s     =   1.0           !        "            "             South 
     9   rn_hts_ini_n     =   0.3           !  initial snow thickness      (m), North 
    810   rn_hts_ini_s     =   0.3           !        "            "             South 
    9    rn_hti_ini_n     =   3.0           !  initial real ice thickness  (m), North 
    10    rn_hti_ini_s     =   1.0           !        "            "             South 
    1111   rn_ati_ini_n     =   0.9           !  initial ice concentration   (-), North 
    1212   rn_ati_ini_s     =   0.9           !        "            "             South 
     
    1515   rn_tmi_ini_n     = 270.            !  initial ice temperature     (K), North 
    1616   rn_tmi_ini_s     = 270.            !        "            "             South 
     17   rn_tsu_ini_n     = 270.            !  initial surface temperature (K), North 
     18   rn_tsu_ini_s     = 270.            !        "            "             South 
    1719   rn_tms_ini_n     = 270.            !  initial snw temperature     (K), North 
    1820   rn_tms_ini_s     = 270.            !        "            "             South 
     
    2123   rn_hpd_ini_n     =   0.05          !  initial pond depth          (m), North 
    2224   rn_hpd_ini_s     =   0.05          !        "            "             South 
    23  
     25   !        ! if ln_iceini_file=T 
    2426   sn_hti = 'Ice_initialization'    , -12 ,'hti'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    2527   sn_hts = 'Ice_initialization'    , -12 ,'hts'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    2628   sn_ati = 'Ice_initialization'    , -12 ,'ati'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     29   sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
     30   sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    2731   sn_tsu = 'Ice_initialization'    , -12 ,'tsu'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    28    sn_tmi = 'Ice_initialization'    , -12 ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    29    sn_smi = 'Ice_initialization'    , -12 ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    3032   sn_tms = 'NOT USED'              , -12 ,'tms'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
    3133   sn_apd = 'NOT USED'              , -12 ,'apd'   ,  .false.  , .true., 'yearly'  , '' , '', '' 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/ICE/iceistate.F90

    r11397 r11401  
    4040   ! 
    4141   !                             !! ** namelist (namini) ** 
    42    LOGICAL  ::   ln_iceini        ! Ice initialization or not 
    43    LOGICAL  ::   ln_iceini_file   ! Ice initialization from 2D netcdf file 
    44    REAL(wp) ::   rn_thres_sst     ! threshold water temperature for initial sea ice 
    45    REAL(wp) ::   rn_hts_ini_n     ! initial snow thickness in the north 
    46    REAL(wp) ::   rn_hts_ini_s     ! initial snow thickness in the south 
    47    REAL(wp) ::   rn_hti_ini_n     ! initial ice thickness in the north 
    48    REAL(wp) ::   rn_hti_ini_s     ! initial ice thickness in the south 
    49    REAL(wp) ::   rn_ati_ini_n     ! initial concentration in the north 
    50    REAL(wp) ::   rn_ati_ini_s     ! initial concentration in the south 
    51    REAL(wp) ::   rn_smi_ini_n     ! initial salinity in the north 
    52    REAL(wp) ::   rn_smi_ini_s     ! initial salinity in the south 
    53    REAL(wp) ::   rn_tmi_ini_n     ! initial ice temperature in the north 
    54    REAL(wp) ::   rn_tmi_ini_s     ! initial ice temperature in the south 
    55    REAL(wp) ::   rn_tms_ini_n     ! initial snw temperature in the north 
    56    REAL(wp) ::   rn_tms_ini_s     ! initial swn temperature in the south 
    57    REAL(wp) ::   rn_apd_ini_n     ! initial pond fraction in the north 
    58    REAL(wp) ::   rn_apd_ini_s     ! initial pond fraction in the south 
    59    REAL(wp) ::   rn_hpd_ini_n     ! initial pond depth in the north 
    60    REAL(wp) ::   rn_hpd_ini_s     ! initial pond depth in the south 
    61  
     42   LOGICAL, PUBLIC  ::   ln_iceini        !: Ice initialization or not 
     43   LOGICAL, PUBLIC  ::   ln_iceini_file   !: Ice initialization from 2D netcdf file 
     44   REAL(wp) ::   rn_thres_sst 
     45   REAL(wp) ::   rn_hti_ini_n, rn_hts_ini_n, rn_ati_ini_n, rn_smi_ini_n, rn_tmi_ini_n, rn_tsu_ini_n, rn_tms_ini_n 
     46   REAL(wp) ::   rn_hti_ini_s, rn_hts_ini_s, rn_ati_ini_s, rn_smi_ini_s, rn_tmi_ini_s, rn_tsu_ini_s, rn_tms_ini_s 
     47   REAL(wp) ::   rn_apd_ini_n, rn_hpd_ini_n 
     48   REAL(wp) ::   rn_apd_ini_s, rn_hpd_ini_s 
     49   ! 
    6250   !                              ! if ln_iceini_file = T 
    6351   INTEGER , PARAMETER ::   jpfldi = 9           ! maximum number of files to read 
     
    6553   INTEGER , PARAMETER ::   jp_hts = 2           ! index of snw thickness    (m) 
    6654   INTEGER , PARAMETER ::   jp_ati = 3           ! index of ice fraction     (-) 
    67    INTEGER , PARAMETER ::   jp_tsu = 4           ! index of ice surface temp (K) 
     55   INTEGER , PARAMETER ::   jp_smi = 4           ! index of ice salinity     (g/kg) 
    6856   INTEGER , PARAMETER ::   jp_tmi = 5           ! index of ice temperature  (K) 
    69    INTEGER , PARAMETER ::   jp_smi = 6           ! index of ice salinity     (g/kg) 
     57   INTEGER , PARAMETER ::   jp_tsu = 6           ! index of ice surface temp (K) 
    7058   INTEGER , PARAMETER ::   jp_tms = 7           ! index of snw temperature  (K) 
    7159   INTEGER , PARAMETER ::   jp_apd = 8           ! index of pnd fraction     (-) 
     
    181169         IF( ln_iceini_file )THEN      ! Read a file   ! 
    182170            !                          !---------------! 
    183             CALL fld_read( kt, 1, si )                ! input fields provided at the current time-step 
    184             ! 
     171            WHERE( ff_t(:,:) >= 0._wp )   ;   zswitch(:,:) = 1._wp 
     172            ELSEWHERE                     ;   zswitch(:,:) = 0._wp 
     173            END WHERE 
     174            ! 
     175            CALL fld_read( kt, 1, si ) ! input fields provided at the current time-step 
     176            ! 
     177            ! -- mandatory fields -- ! 
    185178            zht_i_ini(:,:) = si(jp_hti)%fnow(:,:,1) 
    186179            zht_s_ini(:,:) = si(jp_hts)%fnow(:,:,1) 
    187180            zat_i_ini(:,:) = si(jp_ati)%fnow(:,:,1) 
     181 
     182            ! -- optional fields -- ! 
     183            !    if fields do not exist then set them to the values present in the namelist (except for snow and surface temperature) 
     184            ! 
     185            ! ice salinity 
     186            IF( TRIM(si(jp_smi)%clrootname) == 'NOT USED' ) & 
     187               &     si(jp_smi)%fnow(:,:,1) = ( rn_smi_ini_n * zswitch + rn_smi_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     188            zsm_i_ini(:,:) = si(jp_smi)%fnow(:,:,1) 
     189            ! 
     190            ! ice temperature 
     191            IF( TRIM(si(jp_tmi)%clrootname) == 'NOT USED' ) & 
     192               &     si(jp_tmi)%fnow(:,:,1) = ( rn_tmi_ini_n * zswitch + rn_tmi_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     193            ztm_i_ini(:,:) = si(jp_tmi)%fnow(:,:,1) 
     194            ! 
     195            ! surface temperature => set to ice temperature if it exists 
     196            IF    ( TRIM(si(jp_tsu)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) == 'NOT USED' ) THEN 
     197                     si(jp_tsu)%fnow(:,:,1) = ( rn_tsu_ini_n * zswitch + rn_tsu_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     198            ELSEIF( TRIM(si(jp_tsu)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) /= 'NOT USED' ) THEN 
     199                     si(jp_tsu)%fnow(:,:,1) = si(jp_tmi)%fnow(:,:,1) 
     200            ENDIF 
    188201            zt_su_ini(:,:) = si(jp_tsu)%fnow(:,:,1) 
    189             ztm_i_ini(:,:) = si(jp_tmi)%fnow(:,:,1) 
    190             zsm_i_ini(:,:) = si(jp_smi)%fnow(:,:,1) 
    191             ! snow temperature 
    192             IF( TRIM(si(jp_tms)%clrootname) == 'NOT USED' )   si(jp_tms)%fnow(:,:,1) = si(jp_tmi)%fnow(:,:,1) 
     202            ! 
     203            ! snow temperature => set to ice temperature if it exists 
     204            IF    ( TRIM(si(jp_tms)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) == 'NOT USED' ) THEN 
     205                     si(jp_tms)%fnow(:,:,1) = ( rn_tms_ini_n * zswitch + rn_tms_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
     206            ELSEIF( TRIM(si(jp_tms)%clrootname) == 'NOT USED' .AND. TRIM(si(jp_tmi)%clrootname) /= 'NOT USED' ) THEN 
     207                     si(jp_tms)%fnow(:,:,1) = si(jp_tmi)%fnow(:,:,1) 
     208            ENDIF 
    193209            ztm_s_ini(:,:) = si(jp_tms)%fnow(:,:,1) 
     210            ! 
    194211            ! ponds 
    195             IF( TRIM(si(jp_apd)%clrootname) == 'NOT USED' )   si(jp_apd)%fnow(:,:,1) = 0._wp  
    196             IF( TRIM(si(jp_hpd)%clrootname) == 'NOT USED' )   si(jp_hpd)%fnow(:,:,1) = 0._wp  
     212            IF( TRIM(si(jp_apd)%clrootname) == 'NOT USED' ) & 
     213               &     si(jp_apd)%fnow(:,:,1) = ( rn_apd_ini_n * zswitch + rn_apd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
    197214            zapnd_ini(:,:) = si(jp_apd)%fnow(:,:,1) 
     215            IF( TRIM(si(jp_hpd)%clrootname) == 'NOT USED' ) & 
     216               &     si(jp_hpd)%fnow(:,:,1) = ( rn_hpd_ini_n * zswitch + rn_hpd_ini_s * (1._wp - zswitch) ) * tmask(:,:,1) 
    198217            zhpnd_ini(:,:) = si(jp_hpd)%fnow(:,:,1) 
    199218            ! 
    200             WHERE( zat_i_ini(:,:) > 0._wp ) ; zswitch(:,:) = tmask(:,:,1)  
    201             ELSEWHERE                       ; zswitch(:,:) = 0._wp 
     219            ! change the switch for the following 
     220            WHERE( zat_i_ini(:,:) > 0._wp )   ;   zswitch(:,:) = tmask(:,:,1)  
     221            ELSEWHERE                         ;   zswitch(:,:) = 0._wp 
    202222            END WHERE 
    203223            !                          !---------------! 
     
    214234               zht_s_ini(:,:) = rn_hts_ini_n * zswitch(:,:) 
    215235               zat_i_ini(:,:) = rn_ati_ini_n * zswitch(:,:) 
    216                zt_su_ini(:,:) = rn_tmi_ini_n * zswitch(:,:) 
    217236               zsm_i_ini(:,:) = rn_smi_ini_n * zswitch(:,:) 
    218237               ztm_i_ini(:,:) = rn_tmi_ini_n * zswitch(:,:) 
     238               zt_su_ini(:,:) = rn_tsu_ini_n * zswitch(:,:) 
    219239               ztm_s_ini(:,:) = rn_tms_ini_n * zswitch(:,:) 
    220240               zapnd_ini(:,:) = rn_apd_ini_n * zswitch(:,:) 
     
    224244               zht_s_ini(:,:) = rn_hts_ini_s * zswitch(:,:) 
    225245               zat_i_ini(:,:) = rn_ati_ini_s * zswitch(:,:) 
    226                zt_su_ini(:,:) = rn_tmi_ini_s * zswitch(:,:) 
    227246               zsm_i_ini(:,:) = rn_smi_ini_s * zswitch(:,:) 
    228247               ztm_i_ini(:,:) = rn_tmi_ini_s * zswitch(:,:) 
     248               zt_su_ini(:,:) = rn_tsu_ini_s * zswitch(:,:) 
    229249               ztm_s_ini(:,:) = rn_tms_ini_s * zswitch(:,:) 
    230250               zapnd_ini(:,:) = rn_apd_ini_s * zswitch(:,:) 
     
    296316            DO jj = 1, jpj 
    297317               DO ji = 1, jpi 
    298                   v_i (ji,jj,jl) = h_i(ji,jj,jl) * a_i(ji,jj,jl)              ! ice volume 
    299                   v_s (ji,jj,jl) = h_s(ji,jj,jl) * a_i(ji,jj,jl)              ! snow volume 
     318                  v_i (ji,jj,jl) = h_i(ji,jj,jl) * a_i(ji,jj,jl) 
     319                  v_s (ji,jj,jl) = h_s(ji,jj,jl) * a_i(ji,jj,jl) 
    300320                  sv_i(ji,jj,jl) = MIN( MAX( rn_simin , s_i(ji,jj,jl) ) , rn_simax ) * v_i(ji,jj,jl) 
    301321               END DO 
     
    320340                  DO ji = 1, jpi 
    321341                     t_i (ji,jj,jk,jl) = zti_3d(ji,jj,jl)  
    322                      ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 !Melting temperature in K 
     342                     ztmelts          = - rTmlt * sz_i(ji,jj,jk,jl) + rt0 ! melting temperature in K 
    323343                     e_i(ji,jj,jk,jl) = zswitch(ji,jj) * v_i(ji,jj,jl) * r1_nlay_i * & 
    324344                        &               rhoi * (  rcpi  * ( ztmelts - t_i(ji,jj,jk,jl) ) + & 
     
    429449      ! 
    430450      CHARACTER(len=256) ::  cn_dir          ! Root directory for location of ice files 
    431       TYPE(FLD_N)                    ::   sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi, sn_tms, sn_apd, sn_hpd 
     451      TYPE(FLD_N)                    ::   sn_hti, sn_hts, sn_ati, sn_smi, sn_tmi, sn_tsu, sn_tms, sn_apd, sn_hpd 
    432452      TYPE(FLD_N), DIMENSION(jpfldi) ::   slf_i                 ! array of namelist informations on the fields to read 
    433453      ! 
    434454      NAMELIST/namini/ ln_iceini, ln_iceini_file, rn_thres_sst, & 
    435          &             rn_hts_ini_n, rn_hts_ini_s, rn_hti_ini_n, rn_hti_ini_s, & 
     455         &             rn_hti_ini_n, rn_hti_ini_s, rn_hts_ini_n, rn_hts_ini_s, & 
    436456         &             rn_ati_ini_n, rn_ati_ini_s, rn_smi_ini_n, rn_smi_ini_s, & 
    437          &             rn_tmi_ini_n, rn_tmi_ini_s, rn_tms_ini_n, rn_tms_ini_s, & 
     457         &             rn_tmi_ini_n, rn_tmi_ini_s, rn_tsu_ini_n, rn_tsu_ini_s, rn_tms_ini_n, rn_tms_ini_s, & 
    438458         &             rn_apd_ini_n, rn_apd_ini_s, rn_hpd_ini_n, rn_hpd_ini_s, & 
    439459         &             sn_hti, sn_hts, sn_ati, sn_tsu, sn_tmi, sn_smi, sn_tms, sn_apd, sn_hpd, cn_dir 
     
    449469      ! 
    450470      slf_i(jp_hti) = sn_hti  ;  slf_i(jp_hts) = sn_hts 
    451       slf_i(jp_ati) = sn_ati  ;  slf_i(jp_tsu) = sn_tsu 
    452       slf_i(jp_tmi) = sn_tmi  ;  slf_i(jp_smi) = sn_smi 
    453       slf_i(jp_tms) = sn_tms  ; 
     471      slf_i(jp_ati) = sn_ati  ;  slf_i(jp_smi) = sn_smi 
     472      slf_i(jp_tmi) = sn_tmi  ;  slf_i(jp_tsu) = sn_tsu   ;   slf_i(jp_tms) = sn_tms 
    454473      slf_i(jp_apd) = sn_apd  ;  slf_i(jp_hpd) = sn_hpd 
    455474      ! 
     
    459478         WRITE(numout,*) '~~~~~~~~~~~~~~~' 
    460479         WRITE(numout,*) '   Namelist namini:' 
    461          WRITE(numout,*) '      ice initialization (T) or not (F)                     ln_iceini       = ', ln_iceini 
    462          WRITE(numout,*) '      ice initialization from a netcdf file                 ln_iceini_file  = ', ln_iceini_file 
    463          WRITE(numout,*) '      max delta ocean temp. above Tfreeze with initial ice  rn_thres_sst    = ', rn_thres_sst 
    464          WRITE(numout,*) '      initial snw thickness in the north                    rn_hts_ini_n    = ', rn_hts_ini_n 
    465          WRITE(numout,*) '      initial snw thickness in the south                    rn_hts_ini_s    = ', rn_hts_ini_s  
    466          WRITE(numout,*) '      initial ice thickness in the north                    rn_hti_ini_n    = ', rn_hti_ini_n 
    467          WRITE(numout,*) '      initial ice thickness in the south                    rn_hti_ini_s    = ', rn_hti_ini_s 
    468          WRITE(numout,*) '      initial ice concentr  in the north                    rn_ati_ini_n    = ', rn_ati_ini_n 
    469          WRITE(numout,*) '      initial ice concentr  in the north                    rn_ati_ini_s    = ', rn_ati_ini_s 
    470          WRITE(numout,*) '      initial ice salinity  in the north                    rn_smi_ini_n    = ', rn_smi_ini_n 
    471          WRITE(numout,*) '      initial ice salinity  in the south                    rn_smi_ini_s    = ', rn_smi_ini_s 
    472          WRITE(numout,*) '      initial ice temperat  in the north                    rn_tmi_ini_n    = ', rn_tmi_ini_n 
    473          WRITE(numout,*) '      initial ice temperat  in the south                    rn_tmi_ini_s    = ', rn_tmi_ini_s 
    474          WRITE(numout,*) '      initial snw temperat  in the north                    rn_tms_ini_n    = ', rn_tms_ini_n 
    475          WRITE(numout,*) '      initial snw temperat  in the south                    rn_tms_ini_s    = ', rn_tms_ini_s 
    476          WRITE(numout,*) '      initial pnd fraction  in the north                    rn_apd_ini_n    = ', rn_apd_ini_n 
    477          WRITE(numout,*) '      initial pnd fraction  in the south                    rn_apd_ini_s    = ', rn_apd_ini_s 
    478          WRITE(numout,*) '      initial pnd depth     in the north                    rn_hpd_ini_n    = ', rn_hpd_ini_n 
    479          WRITE(numout,*) '      initial pnd depth     in the south                    rn_hpd_ini_s    = ', rn_hpd_ini_s 
     480         WRITE(numout,*) '      ice initialization (T) or not (F)                ln_iceini      = ', ln_iceini 
     481         WRITE(numout,*) '      ice initialization from a netcdf file            ln_iceini_file = ', ln_iceini_file 
     482         WRITE(numout,*) '      max ocean temp. above Tfreeze with initial ice   rn_thres_sst   = ', rn_thres_sst 
     483         WRITE(numout,*) '      initial snw thickness in the north-south         rn_hts_ini     = ', rn_hts_ini_n,rn_hts_ini_s  
     484         WRITE(numout,*) '      initial ice thickness in the north-south         rn_hti_ini     = ', rn_hti_ini_n,rn_hti_ini_s 
     485         WRITE(numout,*) '      initial ice concentr  in the north-south         rn_ati_ini     = ', rn_ati_ini_n,rn_ati_ini_s 
     486         WRITE(numout,*) '      initial ice salinity  in the north-south         rn_smi_ini     = ', rn_smi_ini_n,rn_smi_ini_s 
     487         WRITE(numout,*) '      initial surf temperat in the north-south         rn_tsu_ini     = ', rn_tsu_ini_n,rn_tsu_ini_s 
     488         WRITE(numout,*) '      initial ice temperat  in the north-south         rn_tmi_ini     = ', rn_tmi_ini_n,rn_tmi_ini_s 
     489         WRITE(numout,*) '      initial snw temperat  in the north-south         rn_tms_ini     = ', rn_tms_ini_n,rn_tms_ini_s 
     490         WRITE(numout,*) '      initial pnd fraction  in the north-south         rn_apd_ini     = ', rn_apd_ini_n,rn_apd_ini_s 
     491         WRITE(numout,*) '      initial pnd depth     in the north-south         rn_hpd_ini     = ', rn_hpd_ini_n,rn_hpd_ini_s 
    480492      ENDIF 
    481493      ! 
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/ICE/icerst.F90

    r11385 r11401  
    1414   !!   ice_rst_read  : read  restart file  
    1515   !!---------------------------------------------------------------------- 
    16    USE ice            ! sea-ice variables 
     16   USE ice            ! sea-ice: variables 
    1717   USE dom_oce        ! ocean domain 
    1818   USE sbc_oce , ONLY : nn_fsbc, ln_cpl 
    19    USE icectl 
     19   USE iceistate      ! sea-ice: initial state 
     20   USE icectl         ! sea-ice: control 
    2021   ! 
    2122   USE in_out_manager ! I/O manager 
     
    120121 
    121122      ! Prognostic variables 
    122       CALL iom_rstput( iter, nitrst, numriw, 'v_i' , v_i  ) 
    123       CALL iom_rstput( iter, nitrst, numriw, 'v_s' , v_s  ) 
    124       CALL iom_rstput( iter, nitrst, numriw, 'sv_i', sv_i ) 
    125       CALL iom_rstput( iter, nitrst, numriw, 'a_i' , a_i  ) 
    126       CALL iom_rstput( iter, nitrst, numriw, 't_su', t_su ) 
    127       ! ice age 
    128       CALL iom_rstput( iter, nitrst, numriw, 'oa_i', oa_i ) 
    129       ! Melt ponds 
    130       CALL iom_rstput( iter, nitrst, numriw, 'a_ip', a_ip ) 
    131       CALL iom_rstput( iter, nitrst, numriw, 'v_ip', v_ip ) 
     123      CALL iom_rstput( iter, nitrst, numriw, 'v_i'  , v_i   ) 
     124      CALL iom_rstput( iter, nitrst, numriw, 'v_s'  , v_s   ) 
     125      CALL iom_rstput( iter, nitrst, numriw, 'sv_i' , sv_i ) 
     126      CALL iom_rstput( iter, nitrst, numriw, 'a_i'  , a_i   ) 
     127      CALL iom_rstput( iter, nitrst, numriw, 't_su' , t_su ) 
     128      CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice ) 
     129      CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice ) 
     130      CALL iom_rstput( iter, nitrst, numriw, 'oa_i' , oa_i  ) 
     131      CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip ) 
     132      CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip ) 
    132133      ! Snow enthalpy 
    133134      DO jk = 1, nlay_s  
     
    144145         CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 
    145146      END DO 
    146       ! ice velocity 
    147       CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice ) 
    148       CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice ) 
    149147      ! fields needed for Met Office (Jules) coupling 
    150148      IF( ln_cpl ) THEN 
     
    172170      INTEGER           ::   jk 
    173171      LOGICAL           ::   llok 
    174       INTEGER           ::   id1, id2            ! local integer 
     172      INTEGER           ::   id0, id1, id2, id3, id4   ! local integer 
    175173      CHARACTER(len=25) ::   znam 
    176174      CHARACTER(len=2)  ::   zchar, zchar1 
     
    187185      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kdlev = jpl ) 
    188186 
    189       CALL iom_get( numrir, 'nn_fsbc', zfice ) 
    190       CALL iom_get( numrir, 'kt_ice' , ziter )     
    191       IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter 
    192       IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1 
    193  
    194       ! Control of date 
    195       IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   & 
    196          &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nit000 in ice restart',  & 
    197          &                   '   verify the file or rerun with the value 0 for the',        & 
    198          &                   '   control of time parameter  nrstdt' ) 
    199       IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   & 
    200          &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nn_fsbc in ice restart',  & 
    201          &                   '   verify the file or rerun with the value 0 for the',         & 
    202          &                   '   control of time parameter  nrstdt' ) 
    203  
    204       ! Prognostic variables  
    205       CALL iom_get( numrir, jpdom_autoglo, 'v_i' , v_i  ) 
    206       CALL iom_get( numrir, jpdom_autoglo, 'v_s' , v_s  ) 
    207       CALL iom_get( numrir, jpdom_autoglo, 'sv_i', sv_i ) 
    208       CALL iom_get( numrir, jpdom_autoglo, 'a_i' , a_i  ) 
    209       CALL iom_get( numrir, jpdom_autoglo, 't_su', t_su ) 
    210       ! ice age 
    211       id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. ) 
    212       IF( id1 > 0 ) THEN                       ! fields exist 
    213          CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i ) 
    214       ELSE                                     ! start from rest 
    215          IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero' 
    216          oa_i(:,:,:) = 0._wp 
    217       ENDIF 
    218       ! Melt ponds 
    219       id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. ) 
    220       IF( id2 > 0 ) THEN                       ! fields exist 
    221          CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip ) 
    222          CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip ) 
    223       ELSE                                     ! start from rest 
    224          IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero' 
    225          a_ip(:,:,:) = 0._wp 
    226          v_ip(:,:,:) = 0._wp 
    227       ENDIF 
    228       ! Snow enthalpy 
    229       DO jk = 1, nlay_s 
    230          WRITE(zchar1,'(I2.2)') jk 
    231          znam = 'e_s'//'_l'//zchar1 
    232          CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
    233          e_s(:,:,jk,:) = z3d(:,:,:) 
    234       END DO 
    235       ! Ice enthalpy 
    236       DO jk = 1, nlay_i 
    237          WRITE(zchar1,'(I2.2)') jk 
    238          znam = 'e_i'//'_l'//zchar1 
    239          CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
    240          e_i(:,:,jk,:) = z3d(:,:,:) 
    241       END DO 
    242       ! ice velocity 
    243       CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice ) 
    244       CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice ) 
    245  
    246       CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
    247  
    248       ! fields needed for Met Office (Jules) coupling 
    249       IF( ln_cpl ) THEN 
    250          CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice ) 
    251          CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice  ) 
     187      ! test if v_i exists  
     188      id0 = iom_varid( numrir, 'v_i' , ldstop = .FALSE. ) 
     189 
     190      !                    ! ------------------------------ ! 
     191      IF( id0 > 0 ) THEN   ! == case of a normal restart == ! 
     192         !                 ! ------------------------------ ! 
     193          
     194         ! Time info 
     195         CALL iom_get( numrir, 'nn_fsbc', zfice ) 
     196         CALL iom_get( numrir, 'kt_ice' , ziter )     
     197         IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter 
     198         IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1 
     199 
     200         ! Control of date 
     201         IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   & 
     202            &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nit000 in ice restart',  & 
     203            &                   '   verify the file or rerun with the value 0 for the',        & 
     204            &                   '   control of time parameter  nrstdt' ) 
     205         IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   & 
     206            &     CALL ctl_stop( 'ice_rst_read ===>>>> : problem with nn_fsbc in ice restart',  & 
     207            &                   '   verify the file or rerun with the value 0 for the',         & 
     208            &                   '   control of time parameter  nrstdt' ) 
     209 
     210         ! --- mandatory fields --- !  
     211         CALL iom_get( numrir, jpdom_autoglo, 'v_i'  , v_i   ) 
     212         CALL iom_get( numrir, jpdom_autoglo, 'v_s'  , v_s   ) 
     213         CALL iom_get( numrir, jpdom_autoglo, 'sv_i' , sv_i  ) 
     214         CALL iom_get( numrir, jpdom_autoglo, 'a_i'  , a_i   ) 
     215         CALL iom_get( numrir, jpdom_autoglo, 't_su' , t_su  ) 
     216         CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice ) 
     217         CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice ) 
     218         ! Snow enthalpy 
     219         DO jk = 1, nlay_s 
     220            WRITE(zchar1,'(I2.2)') jk 
     221            znam = 'e_s'//'_l'//zchar1 
     222            CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
     223            e_s(:,:,jk,:) = z3d(:,:,:) 
     224         END DO 
     225         ! Ice enthalpy 
     226         DO jk = 1, nlay_i 
     227            WRITE(zchar1,'(I2.2)') jk 
     228            znam = 'e_i'//'_l'//zchar1 
     229            CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) 
     230            e_i(:,:,jk,:) = z3d(:,:,:) 
     231         END DO 
     232         ! -- optional fields -- ! 
     233         ! ice age 
     234         id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. ) 
     235         IF( id1 > 0 ) THEN                       ! fields exist 
     236            CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i ) 
     237         ELSE                                     ! start from rest 
     238            IF(lwp) WRITE(numout,*) '   ==>>   previous run without ice age output then set it to zero' 
     239            oa_i(:,:,:) = 0._wp 
     240         ENDIF 
     241         ! melt ponds 
     242         id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. ) 
     243         IF( id2 > 0 ) THEN                       ! fields exist 
     244            CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip ) 
     245            CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip ) 
     246         ELSE                                     ! start from rest 
     247            IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds output then set it to zero' 
     248            a_ip(:,:,:) = 0._wp 
     249            v_ip(:,:,:) = 0._wp 
     250         ENDIF 
     251         ! fields needed for Met Office (Jules) coupling 
     252         IF( ln_cpl ) THEN 
     253            id3 = iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. ) 
     254            id4 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. ) 
     255            IF( id3 > 0 .AND. id4 > 0 ) THEN         ! fields exist 
     256               CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice ) 
     257               CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice  ) 
     258            ELSE                                     ! start from rest 
     259               IF(lwp) WRITE(numout,*) '   ==>>   previous run without conductivity output then set it to zero' 
     260               cnd_ice(:,:,:) = 0._wp 
     261               t1_ice (:,:,:) = rt0 
     262            ENDIF 
     263         ENDIF 
     264 
     265         CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
     266 
     267         !                 ! ---------------------------------- ! 
     268      ELSE                 ! == case of a simplified restart == ! 
     269         !                 ! ---------------------------------- ! 
     270         CALL ctl_warn('ice_rst_read: you are using a simplified ice restart') 
     271         ! 
     272         CALL ice_istate_init 
     273         CALL ice_istate( nit000 ) 
     274         ! 
     275         IF( .NOT.ln_iceini .OR. .NOT.ln_iceini_file ) & 
     276            &   CALL ctl_stop('STOP', 'ice_rst_read: you need ln_ice_ini=T and ln_iceini_file=T') 
     277         ! 
    252278      ENDIF 
    253279 
Note: See TracChangeset for help on using the changeset viewer.