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

Changeset 4525


Ignore:
Timestamp:
2014-03-13T16:35:37+01:00 (10 years ago)
Author:
flavoni
Message:

change limwri.F90, use iom_put for all variables

Location:
branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM
Files:
2 added
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/field_def.xml

    r4345 r4525  
    231231         <field id="micesalt"     long_name="Mean ice salinity"                                            unit="psu"      /> 
    232232         <field id="miceage"      long_name="Mean ice age"                                                 unit="years"    /> 
     233 
     234         <field id="iceage_cat"   long_name="Ice age for categories"                                       unit="days"   axis_ref="ncatice" /> 
     235         <field id="iceconc_cat"  long_name="Ice concentration for categories"                             unit="%"      axis_ref="ncatice" /> 
     236         <field id="icethic_cat"  long_name="Ice thickness for categories"                                 unit="m"      axis_ref="ncatice" /> 
     237         <field id="snowthic_cat" long_name="Snow thicknessi for categories"                               unit="m"      axis_ref="ncatice" /> 
     238         <field id="salinity_cat" long_name="Sea-Ice Bulk salinity for categories"                         unit="ppt"    axis_ref="ncatice" /> 
     239         <field id="brinevol_cat" long_name="Brine volume for categories"                                  unit="%"      axis_ref="ncatice" /> 
     240 
    233241         <field id="icelapr"      long_name="daily lateral thermo ice prod."                               unit="m/day"   /> 
    234242         <field id="icesipr"      long_name="daily snowice ice prod."                                      unit="m/day"   /> 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/iodef.xml

    r4350 r4525  
    132132          <field field_ref="icecolf"          name="sicolf" /> 
    133133 
     134          <field field_ref="iceage_cat"       name="siagecat"/> 
     135          <field field_ref="iceconc_cat"      name="siconcat"/> 
     136          <field field_ref="icethic_cat"      name="sithicat"/> 
     137          <field field_ref="snowthic_cat"     name="sndeptcat"/> 
     138          <field field_ref="salinity_cat"     name="salincat"/> 
     139          <field field_ref="brinevol_cat"     name="sibrincat"/> 
     140 
    134141   </file> 
    135142 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_ice

    r4345 r4525  
    2222   ln_nicep    = .false.   !  Ice points output for debug (yes or no) 
    2323   ln_limdiahsb  = .false.    !  check the heat and salt budgets (T) or not (F) 
    24    ln_limdiaout  = .true.    !  output the heat and salt budgets (T) or not (F) 
     24   ln_limdiaout  = .false.    !  output the heat and salt budgets (T) or not (F) 
    2525/ 
    2626!----------------------------------------------------------------------- 
     
    5858   telast      =9600.0     !  timescale for elastic waves, SB, 720.0 
    5959   alphaevp    =   1.0     !  coefficient for the solution of internal ice stresses 
    60    hminrhg     =   0.001   !  ice thickness (m) below which ice velocity equal ocean velocity 
     60   hminrhg     =   0.001   !  ice volume (a*h in m) below which ice velocity equal ocean velocity 
    6161/ 
    6262!----------------------------------------------------------------------- 
     
    149149&namiceout     !   parameters for outputs 
    150150!----------------------------------------------------------------------- 
    151    noumef      =   43      !  number of fields 
    152    add_diag_swi=    1      !  1 -> diagnose distribution in thickness space 
    153                            !  0 -> only simple diagnostics 
     151!   noumef      =   43      !  number of fields 
     152!SF   add_diag_swi=    1      !  1 -> diagnose distribution in thickness space 
     153!SF                           !  0 -> only simple diagnostics 
    154154! 
    155155!           !         title of the field           !  name     !   units   !  save  ! multipl. ! additive ! 
    156156!           !                                      !           !           ! or not !  factor  !  factor  ! 
    157    field_1  = 'Ice concentration                  ', 'iiceconc', '%       ',    1   ,  1.0     ,    0.0 
    158    field_2  = 'Ice thickness                      ', 'iicethic', 'm       ',    1   ,  1.0     ,    0.0 
    159    field_3  = 'Snow thickness                     ', 'isnowthi', 'm       ',    1   ,  1.0     ,    0.0 
    160    field_4  = 'Daily bottom thermo ice production ', 'iicebopr', 'km3/day ',    1   , 1.0e-9   ,    0.0 
    161    field_5  = 'Daily dynamic ice production       ', 'iicedypr', 'km3/day ',    1   , 1.0e-9   ,    0.0 
    162    field_6  = 'Oceanic flux at the ice base       ', 'ioceflxb', 'w/m2    ',    1   ,  1.0     ,    0.0 
    163    field_7  = 'Ice velocity u                     ', 'iicevelu', 'm/s     ',    1   ,  1.0     ,    0.0 
    164    field_8  = 'Ice velocity v                     ', 'iicevelv', 'm/s     ',    1   ,  1.0     ,    0.0 
    165    field_9  = 'Sea surface temperature            ', 'isstempe', 'C       ',    1   ,  1.0     , -273.15 
    166    field_10 = 'Sea surface salinity               ', 'isssalin', 'PSU     ',    1   ,  1.0     ,    0.0 
    167    field_11 = 'Total flux at ocean surface        ', 'iocetflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    168    field_12 = 'Solar flux at ocean surface        ', 'iocesflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    169    field_13 = 'Non-solar flux at ocean surface    ', 'iocwnsfl', 'w/m2    ',    1   ,  1.0     ,    0.0 
    170    field_14 = 'Heat flux due to brine release     ', 'iocehebr', 'w/m2    ',    1   ,  1.0     ,    0.0 
    171    field_15 = 'Wind stress u                      ', 'iocestru', 'Pa      ',    1   ,  1.0     ,    0.0 
    172    field_16 = 'Wind stress v                      ', 'iocestrv', 'Pa      ',    1   ,  1.0     ,    0.0  
    173    field_17 = 'Solar flux at ice/ocean surface    ', 'iicesflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    174    field_18 = 'Non-solar flux at ice/ocean surface', 'iicenflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    175    field_19 = 'Snow precipitation                 ', 'isnowpre', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    176    field_20 = 'Mean ice salinity                  ', 'iicesali', 'psu     ',    1   ,  1.0     ,    0.0 
    177    field_21 = 'Mean ice age                       ', 'iiceages', 'years   ',    1   ,  0.002739,    0.0 
    178    field_22 = 'Daily lateral thermo ice prod.     ', 'iicelapr', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    179    field_23 = 'Daily snowice ice production       ', 'iicesipr', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    180    field_24 = 'Mean ice temperature               ', 'iicetemp', 'C       ',    1   ,  1.0     , -273.15 
    181    field_25 = 'Ice total heat content             ', 'iiceheco', '10^9 J  ',    1   ,  1.0     ,    0.0 
    182    field_26 = 'Ice surface temperature            ', 'iicesurt', 'C       ',    1   ,  1.0     , -273.15 
    183    field_27 = 'Snow temperature                   ', 'isnotem2', 'C       ',    1   ,  1.0     , -273.15 
    184    field_28 = 'Fsbri - brine salt flux            ', 'iicefsbr', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    185    field_29 = 'Fseqv - equivalent FW salt flux    ', 'iicefseq', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    186    field_30 = 'Brine volume                       ', 'ibrinvol', '%       ',    1   ,  100.0   ,    0.0 
    187    field_31 = 'Frazil ice collection thickness    ', 'iicecolf', 'm       ',    1   ,  1.0     ,    0.0 
    188    field_32 = 'Ice strength                       ', 'iicestre', 'N/m     ',    1   ,  0.001   ,    0.0 
    189    field_33 = 'Ice velocity                       ', 'iicevelo', 'm/s     ',    1   ,  1.0     ,    0.0 
    190    field_34 = 'Surface melt                       ', 'iicesume', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    191    field_35 = 'Bottom melt                        ', 'iicebome', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    192    field_36 = 'Divergence                         ', 'iicedive', '10-8s-1 ',    1   ,  1.0e8   ,    0.0 
    193    field_37 = 'Shear                              ', 'iiceshea', '10-8s-1 ',    1   ,  1.0e8   ,    0.0 
    194    field_38 = 'Daily resultant ice prod/melt      ', 'iicerepr', 'km3/day ',    1   ,  1.0e-9  ,    0.0 
    195    field_39 = 'Ice volume                         ', 'iicevolu', 'km3     ',    1   ,  1.0e-9  ,    0.0 
    196    field_40 = 'Snow volume                        ', 'isnowvol', 'km3     ',    1   ,  1.0e-9  ,    0.0 
    197    field_41 = 'Fsrpo - salt flux from ridg/raft   ', 'iicefsrp', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    198    field_42 = 'Fsres - salt flux from limupdate   ', 'iicefsre', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    199    field_43 = 'Ice volume transport               ', 'iicevtrp', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    200157/  
    201158 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_ice_lim3

    r4345 r4525  
    2222   ln_nicep    = .false.   !  Ice points output for debug (yes or no) 
    2323   ln_limdiahsb  = .false.    !  check the heat and salt budgets (T) or not (F) 
    24    ln_limdiaout  = .true.    !  output the heat and salt budgets (T) or not (F) 
     24   ln_limdiaout  = .false.    !  output the heat and salt budgets (T) or not (F) 
    2525/ 
    2626!----------------------------------------------------------------------- 
     
    149149&namiceout     !   parameters for outputs 
    150150!----------------------------------------------------------------------- 
    151    noumef      =   43      !  number of fields 
    152    add_diag_swi=    1      !  1 -> diagnose distribution in thickness space 
    153                            !  0 -> only simple diagnostics 
     151!   noumef      =   43      !  number of fields 
     152!SF   add_diag_swi=    1      !  1 -> diagnose distribution in thickness space 
     153!SF                           !  0 -> only simple diagnostics 
    154154! 
    155155!           !         title of the field           !  name     !   units   !  save  ! multipl. ! additive ! 
    156156!           !                                      !           !           ! or not !  factor  !  factor  ! 
    157    field_1  = 'Ice concentration                  ', 'iiceconc', '%       ',    1   ,  1.0     ,    0.0 
    158    field_2  = 'Ice thickness                      ', 'iicethic', 'm       ',    1   ,  1.0     ,    0.0 
    159    field_3  = 'Snow thickness                     ', 'isnowthi', 'm       ',    1   ,  1.0     ,    0.0 
    160    field_4  = 'Daily bottom thermo ice production ', 'iicebopr', 'km3/day ',    1   , 1.0e-9   ,    0.0 
    161    field_5  = 'Daily dynamic ice production       ', 'iicedypr', 'km3/day ',    1   , 1.0e-9   ,    0.0 
    162    field_6  = 'Oceanic flux at the ice base       ', 'ioceflxb', 'w/m2    ',    1   ,  1.0     ,    0.0 
    163    field_7  = 'Ice velocity u                     ', 'iicevelu', 'm/s     ',    1   ,  1.0     ,    0.0 
    164    field_8  = 'Ice velocity v                     ', 'iicevelv', 'm/s     ',    1   ,  1.0     ,    0.0 
    165    field_9  = 'Sea surface temperature            ', 'isstempe', 'C       ',    1   ,  1.0     , -273.15 
    166    field_10 = 'Sea surface salinity               ', 'isssalin', 'PSU     ',    1   ,  1.0     ,    0.0 
    167    field_11 = 'Total flux at ocean surface        ', 'iocetflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    168    field_12 = 'Solar flux at ocean surface        ', 'iocesflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    169    field_13 = 'Non-solar flux at ocean surface    ', 'iocwnsfl', 'w/m2    ',    1   ,  1.0     ,    0.0 
    170    field_14 = 'Heat flux due to brine release     ', 'iocehebr', 'w/m2    ',    1   ,  1.0     ,    0.0 
    171    field_15 = 'Wind stress u                      ', 'iocestru', 'Pa      ',    1   ,  1.0     ,    0.0 
    172    field_16 = 'Wind stress v                      ', 'iocestrv', 'Pa      ',    1   ,  1.0     ,    0.0  
    173    field_17 = 'Solar flux at ice/ocean surface    ', 'iicesflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    174    field_18 = 'Non-solar flux at ice/ocean surface', 'iicenflx', 'w/m2    ',    1   ,  1.0     ,    0.0 
    175    field_19 = 'Snow precipitation                 ', 'isnowpre', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    176    field_20 = 'Mean ice salinity                  ', 'iicesali', 'psu     ',    1   ,  1.0     ,    0.0 
    177    field_21 = 'Mean ice age                       ', 'iiceages', 'years   ',    1   ,  0.002739,    0.0 
    178    field_22 = 'Daily lateral thermo ice prod.     ', 'iicelapr', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    179    field_23 = 'Daily snowice ice production       ', 'iicesipr', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    180    field_24 = 'Mean ice temperature               ', 'iicetemp', 'C       ',    1   ,  1.0     , -273.15 
    181    field_25 = 'Ice total heat content             ', 'iiceheco', '10^9 J  ',    1   ,  1.0     ,    0.0 
    182    field_26 = 'Ice surface temperature            ', 'iicesurt', 'C       ',    1   ,  1.0     , -273.15 
    183    field_27 = 'Snow temperature                   ', 'isnotem2', 'C       ',    1   ,  1.0     , -273.15 
    184    field_28 = 'Fsbri - brine salt flux            ', 'iicefsbr', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    185    field_29 = 'Fseqv - equivalent FW salt flux    ', 'iicefseq', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    186    field_30 = 'Brine volume                       ', 'ibrinvol', '%       ',    1   ,  100.0   ,    0.0 
    187    field_31 = 'Frazil ice collection thickness    ', 'iicecolf', 'm       ',    1   ,  1.0     ,    0.0 
    188    field_32 = 'Ice strength                       ', 'iicestre', 'N/m     ',    1   ,  0.001   ,    0.0 
    189    field_33 = 'Ice velocity                       ', 'iicevelo', 'm/s     ',    1   ,  1.0     ,    0.0 
    190    field_34 = 'Surface melt                       ', 'iicesume', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    191    field_35 = 'Bottom melt                        ', 'iicebome', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    192    field_36 = 'Divergence                         ', 'iicedive', '10-8s-1 ',    1   ,  1.0e8   ,    0.0 
    193    field_37 = 'Shear                              ', 'iiceshea', '10-8s-1 ',    1   ,  1.0e8   ,    0.0 
    194    field_38 = 'Daily resultant ice prod/melt      ', 'iicerepr', 'km3/day ',    1   ,  1.0e-9  ,    0.0 
    195    field_39 = 'Ice volume                         ', 'iicevolu', 'km3     ',    1   ,  1.0e-9  ,    0.0 
    196    field_40 = 'Snow volume                        ', 'isnowvol', 'km3     ',    1   ,  1.0e-9  ,    0.0 
    197    field_41 = 'Fsrpo - salt flux from ridg/raft   ', 'iicefsrp', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    198    field_42 = 'Fsres - salt flux from limupdate   ', 'iicefsre', 'kg/m2/d ',    1   ,  1.0     ,    0.0 
    199    field_43 = 'Ice volume transport               ', 'iicevtrp', 'km3/day ',    1   ,1.0e-9    ,    0.0 
    200157/  
    201158 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/CONFIG/ORCA2_LIM3/IGCM00/config.card

    r4100 r4525  
    11# 
    2 # This is config.card file for NEMO ORCA2_LIM2 configuration 
     2# This is config.card file for NEMO ORCA2_LIM3 configuration 
    33# 
    44#======================================================================== 
     
    4747#D- For each component, Name of component, Tag of component 
    4848OCE= (opa9, NEMO_v3) 
    49 ICE= (lim2, LIM_2) 
     49ICE= (lim3, LIM_3) 
    5050 
    5151#======================================================================== 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/CONFIG/SHARED/field_def.xml

    r4098 r4525  
    231231         <field id="micesalt"     long_name="Mean ice salinity"                                            unit="psu"      /> 
    232232         <field id="miceage"      long_name="Mean ice age"                                                 unit="years"    /> 
     233 
     234         <field id="iceage_cat"   long_name="Ice age for categories"                                       unit="days"   axis_ref="ncatice" /> 
     235         <field id="iceconc_cat"  long_name="Ice concentration for categories"                             unit="%"      axis_ref="ncatice" /> 
     236         <field id="icethic_cat"  long_name="Ice thickness for categories"                                 unit="m"      axis_ref="ncatice" /> 
     237         <field id="snowthic_cat" long_name="Snow thicknessi for categories"                               unit="m"      axis_ref="ncatice" /> 
     238         <field id="salinity_cat" long_name="Sea-Ice Bulk salinity for categories"                         unit="ppt"    axis_ref="ncatice" /> 
     239         <field id="brinevol_cat" long_name="Brine volume for categories"                                  unit="%"      axis_ref="ncatice" /> 
     240 
    233241         <field id="icelapr"      long_name="daily lateral thermo ice prod."                               unit="km3/day"   /> 
    234242         <field id="icesipr"      long_name="daily snowice ice prod."                                      unit="km3/day"   /> 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90

    r4332 r4525  
    99   !!---------------------------------------------------------------------- 
    1010   !!   lim_wri      : write of the diagnostics variables in ouput file  
    11    !!   lim_wri_init : initialization and namelist read 
    1211   !!   lim_wri_state : write for initial state or/and abandon 
    1312   !!---------------------------------------------------------------------- 
     
    3635   PUBLIC lim_wri_state  ! called by dia_wri_state  
    3736 
    38    INTEGER, PARAMETER ::   jpnoumax = 43   !: maximum number of variable for ice output 
    39     
    40    INTEGER  ::   noumef             ! number of fields 
    41    INTEGER  ::   noumefa            ! number of additional fields 
    42    INTEGER  ::   add_diag_swi       ! additional diagnostics 
    43    INTEGER  ::   nz                                         ! dimension for the itd field 
    44  
    45    REAL(wp) , DIMENSION(jpnoumax) ::   cmulti         ! multiplicative constant 
    46    REAL(wp) , DIMENSION(jpnoumax) ::   cadd           ! additive constant 
    47    REAL(wp) , DIMENSION(jpnoumax) ::   cmultia        ! multiplicative constant 
    48    REAL(wp) , DIMENSION(jpnoumax) ::   cadda          ! additive constant 
    49    CHARACTER(len = 35), DIMENSION(jpnoumax) ::   titn, titna   ! title of the field 
    50    CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::   nam , nama    ! name of the field 
    51    CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::   uni , unia    ! unit of the field 
    52    INTEGER            , DIMENSION(jpnoumax) ::   nc  , nca     ! switch for saving field ( = 1 ) or not ( = 0 ) 
    53  
    5437   REAL(wp)  ::   epsi06 = 1.e-6_wp 
    5538   REAL(wp)  ::   zzero  = 0._wp 
     
    7861      INTEGER, INTENT(in) ::   kindic   ! if kindic < 0 there has been an error somewhere 
    7962      ! 
    80       INTEGER ::  ji, jj, jk, jl, jf, ipl ! dummy loop indices 
    81       INTEGER ::  ierr 
    82       REAL(wp),DIMENSION(1) ::   zdept 
    83       REAL(wp) ::  zsto, zjulian, zout, zindh, zinda, zindb, zindc 
    84       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zcmo, zcmoa 
    85       REAL(wp), POINTER, DIMENSION(:,:  ) ::   zfield 
    86       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zmaskitd, zoi, zei 
    87  
    88       CHARACTER(len = 60) ::   clhstnam, clop, clhstnama 
    89  
    90       INTEGER , SAVE ::   nice, nhorid, ndim, niter, ndepid 
    91       INTEGER , SAVE ::   nicea, nhorida, ndimitd 
    92       INTEGER , ALLOCATABLE, DIMENSION(:), SAVE ::   ndex51 
    93       INTEGER , ALLOCATABLE, DIMENSION(:), SAVE ::   ndexitd 
     63      INTEGER ::  ji, jj, jk, jl  ! dummy loop indices 
     64      REAL(wp) ::  zinda, zindb, z1_365 
     65      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zoi, zei 
     66      REAL(wp), POINTER, DIMENSION(:,:)   :: z2d, z2da, z2db, zind    ! 2D workspace 
    9467      !!------------------------------------------------------------------- 
    9568 
    9669      IF( nn_timing == 1 )  CALL timing_start('limwri') 
    9770 
    98       CALL wrk_alloc( jpi, jpj, zfield ) 
    99       CALL wrk_alloc( jpi, jpj, jpnoumax, zcmo, zcmoa ) 
    100       CALL wrk_alloc( jpi, jpj, jpl, zmaskitd, zoi, zei ) 
    101  
    102       ipl = jpl 
    103  
    104       IF( numit == nstart ) THEN  
    105  
    106          ALLOCATE( ndex51(jpij), ndexitd(jpij*jpl), STAT=ierr ) 
    107          IF( lk_mpp    )   CALL mpp_sum ( ierr ) 
    108          IF( ierr /= 0 ) THEN 
    109             CALL ctl_stop( 'lim_wri : unable to allocate standard arrays' )   ;   RETURN 
    110          ENDIF 
    111  
    112          CALL lim_wri_init  
    113  
    114          IF(lwp) WRITE(numout,*) ' lim_wri, first time step ' 
    115          IF(lwp) WRITE(numout,*) ' add_diag_swi ', add_diag_swi 
    116  
    117          !-------------------- 
    118          !  1) Initialization 
    119          !-------------------- 
    120  
    121          !------------- 
    122          ! Normal file 
    123          !------------- 
    124          niter    = ( nit000 - 1 ) / nn_fsbc 
    125          CALL ymds2ju ( nyear, nmonth, nday, rdt, zjulian ) 
    126          zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    127 !clem 
    128 !         zsto     = rdt_ice 
    129 !         IF( ln_mskland )   THEN   ;   clop = "ave(only(x))"   ! put 1.e+20 on land (very expensive!!) 
    130 !         ELSE                      ;   clop = "ave(x)"         ! no use of the mask value (require less cpu time) 
    131 !         ENDIF 
    132 !         zout     = nwrite * rdt_ice / nn_fsbc 
    133 !         zdept(1) = 0. 
    134 ! 
    135 !         CALL dia_nam ( clhstnam, nwrite, 'icemod_old' ) 
    136 !         CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit, 1, jpi, 1, jpj, niter, zjulian, rdt_ice,   & 
    137 !            &           nhorid, nice, domain_id=nidom, snc4chunks=snc4set ) 
    138 !         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid, "down") 
    139 !         CALL wheneq  ( jpij , tmask(:,:,1), 1, 1., ndex51, ndim) 
    140 ! 
    141 !         DO jf = 1 , noumef 
    142 !            IF(lwp) WRITE(numout,*) 'jf', jf 
    143 !            IF ( nc(jf) == 1 ) THEN 
    144 !               CALL histdef( nice, nam(jf), titn(jf), uni(jf), jpi, jpj & 
    145 !                  , nhorid, 1, 1, 1, -99, 32, clop, zsto, zout ) 
    146 !               IF(lwp) WRITE(numout,*) 'nice, nam(jf), titn(jf), uni(jf), nhorid, clop, zsto, zout' 
    147 !               IF(lwp) WRITE(numout,*)  nice, nam(jf), titn(jf), uni(jf), nhorid, clop, zsto, zout  
    148 !            ENDIF 
    149 !         END DO 
    150 ! 
    151 !         CALL histend(nice, snc4set) 
    152 !clem 
    153          ! 
    154          !----------------- 
    155          ! ITD file output 
    156          !----------------- 
    157          zsto     = rdt_ice 
    158          clop     = "ave(x)" 
    159          zout     = nwrite * rdt_ice / nn_fsbc 
    160          zdept(1) = 0. 
    161  
    162          CALL dia_nam ( clhstnama, nwrite, 'icemoa' ) 
    163          CALL histbeg ( clhstnama, jpi, glamt, jpj, gphit,         & 
    164             1, jpi, 1, jpj,            & ! zoom 
    165             niter, zjulian, rdt_ice,   & ! time 
    166             nhorida,                   & ! ? linked with horizontal ... 
    167             nicea , domain_id=nidom, snc4chunks=snc4set)                  ! file  
    168          CALL histvert( nicea, "icethi", "L levels","m", ipl , hi_mean , nz ) 
    169          DO jl = 1, jpl 
    170             zmaskitd(:,:,jl) = tmask(:,:,1) 
    171          END DO 
    172          CALL wheneq  ( jpij , tmask(:,:,1), 1, 1., ndex51, ndim) 
    173          CALL wheneq( jpi*jpj*jpl, zmaskitd, 1, 1., ndexitd, ndimitd  )   
    174          CALL histdef( nicea, "iice_itd", "Ice area in categories"         , "-"    ,   &   
    175             jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    176          CALL histdef( nicea, "iice_hid", "Ice thickness in categories"    , "m"    ,   &   
    177             jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    178          CALL histdef( nicea, "iice_hsd", "Snow depth in in categories"    , "m"    ,   &   
    179             jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    180          CALL histdef( nicea, "iice_std", "Ice salinity distribution"      , "ppt"  ,   &   
    181             jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    182          CALL histdef( nicea, "iice_otd", "Ice age distribution"               , "days",   &   
    183             jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    184          CALL histdef( nicea, "iice_etd", "Brine volume distr. "               , "%"    ,   &   
    185             jpi, jpj, nhorida, jpl, 1, jpl, nz, 15, clop, zsto, zout ) 
    186          CALL histend(nicea, snc4set) 
    187       ENDIF 
    188  
    189       !     !-----------------------------------------------------------------------! 
    190       !     !--2. Computation of instantaneous values                               !  
    191       !     !-----------------------------------------------------------------------! 
    192  
    193       !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    194       !IF( ln_nicep ) THEN 
    195       !   WRITE(numout,*) 
    196       !   WRITE(numout,*) 'lim_wri : write ice outputs in NetCDF files at time : ', nyear, nmonth, nday, numit 
    197       !   WRITE(numout,*) '~~~~~~~ ' 
    198       !   WRITE(numout,*) ' kindic = ', kindic 
    199       !ENDIF 
    200       !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    201  
    202       !-- calculs des valeurs instantanees 
    203       zcmo ( 1:jpi, 1:jpj, 1:jpnoumax ) = 0._wp 
    204       zcmoa( 1:jpi, 1:jpj, 1:jpnoumax ) = 0._wp 
    205  
    206       ! Ice surface temperature and some fluxes 
     71      CALL wrk_alloc( jpi, jpj, jpl, zoi, zei ) 
     72      CALL wrk_alloc( jpi, jpj     , z2d, z2da, z2db, zind ) 
     73 
     74 
     75      !----------------------------- 
     76      ! Mean category values 
     77      !----------------------------- 
     78 
     79      CALL lim_var_icetm      ! mean sea ice temperature 
     80 
     81      CALL lim_var_bv         ! brine volume 
     82 
     83      DO jj = 1, jpj          ! presence indicator of ice 
     84         DO ji = 1, jpi 
     85            zind(ji,jj)  = MAX( zzero , SIGN( zone , at_i(ji,jj) - epsi06 ) ) 
     86         END DO 
     87      END DO 
     88      ! 
     89      ! 
     90      CALL iom_put( "iceconc"      , at_i               )        ! ice concentration 
     91      !                                              
     92      DO jj = 1, jpj                                             ! mean ice thickness 
     93         DO ji = 1, jpi 
     94            z2d(ji,jj)  = vt_i(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zind(ji,jj) 
     95         END DO 
     96      END DO 
     97      CALL iom_put( "icethic_cea"  , z2d                 )       ! ice thickness (i.e. icethi(:,:)) 
     98      CALL iom_put( "icevolu"      , vt_i                )       ! ice volume = mean ice thickness over the cell 
     99      DO jj = 1, jpj                                             
     100         DO ji = 1, jpi 
     101            z2d(ji,jj)  = vt_s(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zind(ji,jj) 
     102         END DO 
     103      END DO 
     104      CALL iom_put( "snowthic_cea" , z2d                 )       ! snow thickness = mean snow thickness over the cell 
     105      CALL iom_put( "ioceflxb"     , fbif * at_i         )       ! oceanic flux at the ice base 
     106      CALL iom_put( "isst"         , sst_m               )       ! sea surface temperature 
     107      CALL iom_put( "isss"         , sss_m               )       ! sea surface salinity 
     108      CALL iom_put( "qt_oce"       , qns + qsr           )       ! total flux at ocean surface 
     109      ! 
     110      DO jj = 2 , jpjm1 
     111         DO ji = 2 , jpim1 
     112            z2da(ji,jj)  = (  u_ice(ji,jj) * tmu(ji,jj) + u_ice(ji-1,jj) * tmu(ji-1,jj) ) * 0.5_wp 
     113            z2db(ji,jj)  = (  v_ice(ji,jj) * tmv(ji,jj) + v_ice(ji,jj-1) * tmv(ji,jj-1) ) * 0.5_wp 
     114        END DO 
     115      END DO 
     116      CALL lbc_lnk( z2da, 'T', -1. ) 
     117      CALL lbc_lnk( z2db, 'T', -1. ) 
     118      DO jj = 1, jpj                                  
     119         DO ji = 1, jpi 
     120            z2d(ji,jj)  = SQRT( z2da(ji,jj) * z2da(ji,jj) + z2db(ji,jj) * z2db(ji,jj) )  
     121         END DO 
     122      END DO 
     123      CALL iom_put( "uice_ipa"     , z2da                )       ! ice velocity u component 
     124      CALL iom_put( "vice_ipa"     , z2db                )       ! ice velocity v component 
     125      CALL iom_put( "icevel"       , z2d                 )       ! ice velocity module 
     126      CALL iom_put( "icebopr"      , diag_bot_gr * rday  )       ! daily bottom thermodynamic ice production 
     127      CALL iom_put( "icedypr"      , diag_dyn_gr * rday  )       ! daily dynamic ice production (rid/raft) 
     128!!SF BE CAREFUL : qsr_oce qnd qns_oce are after penetration over ice 
     129      CALL iom_put( "qsr_oce"      , qsr                 )       ! solar flux at ocean surface 
     130      CALL iom_put( "qns_oce"      , qns                 )       ! non-solar flux at ocean surface 
     131!!SF end be careful 
     132      CALL iom_put( "hfbri"        , fhbri               )       ! heat flux due to brine release 
     133      CALL iom_put( "utau_ice"     , utau_ice            )       ! wind stress over ice along i-axis at I-point 
     134      CALL iom_put( "vtau_ice"     , vtau_ice            )       ! wind stress over ice along j-axis at I-point 
     135!!SF commented because this computation is not ok 
     136 !SF because qsr is not qsr_ocean but it contains already qsr_ice 
     137      !SF 
     138      !SF DO jj = 1 , jpj 
     139      !SF    DO ji = 1 , jpi 
     140      !SF       z2d(ji,jj)  = ( 1._wp - at_i(ji,jj) ) * qsr(ji,jj) 
     141      !SF   END DO 
     142      !SF END DO 
     143      !SF CALL iom_put( "qsr_io"       , z2d                 )        ! solar flux at ice/ocean surface 
     144      !SF DO jj = 1 , jpj 
     145      !SF    DO ji = 1 , jpi 
     146      !SF       z2d(ji,jj)  = ( 1._wp - at_i(ji,jj) ) * qns(ji,jj) 
     147      !SF   END DO 
     148      !SF END DO 
     149      !SF CALL iom_put( "qns_io"       , z2d                 )        ! non-solar flux at ice/ocean surface 
     150      CALL iom_put( "snowpre"      , sprecip             )        ! snow precipitation  
     151      CALL iom_put( "micesalt"     , smt_i               )        ! mean ice salinity 
     152      ! 
     153      z2d(:,:) = 0.e0 
    207154      DO jl = 1, jpl 
    208155         DO jj = 1, jpj 
    209156            DO ji = 1, jpi 
    210                zinda  = MAX( zzero , SIGN( zone , at_i(ji,jj) - epsi06 ) ) 
    211                zcmo(ji,jj,17) = zcmo(ji,jj,17) + a_i(ji,jj,jl)*qsr_ice (ji,jj,jl)  
    212                zcmo(ji,jj,18) = zcmo(ji,jj,18) + a_i(ji,jj,jl)*qns_ice(ji,jj,jl)  
    213                zcmo(ji,jj,27) = zcmo(ji,jj,27) + zinda*(t_su(ji,jj,jl)-rtt)*a_i(ji,jj,jl)/MAX(at_i(ji,jj),epsi06) 
    214                zcmo(ji,jj,21) = zcmo(ji,jj,21) + zinda*oa_i(ji,jj,jl)/MAX(at_i(ji,jj),epsi06)  
     157               z2d(ji,jj) = z2d(ji,jj) + zind(ji,jj) * oa_i(ji,jj,jl) 
    215158            END DO 
    216159         END DO 
    217160      END DO 
    218  
    219       ! Mean sea ice temperature 
    220       CALL lim_var_icetm 
    221  
    222       ! Brine volume 
    223       CALL lim_var_bv 
    224  
    225       DO jj = 2 , jpjm1 
    226          DO ji = 2 , jpim1 
    227             zinda  = MAX( zzero , SIGN( zone , at_i(ji,jj) - epsi06 ) ) 
     161      z1_365 = 1._wp / 365._wp 
     162      CALL iom_put( "miceage"     , z2d * z1_365         )        ! mean ice age 
     163      CALL iom_put( "icelapr"     , diag_lat_gr * rday   )        ! daily lateral thermodynamic ice production 
     164      CALL iom_put( "icesipr"     , diag_sni_gr * rday   )        ! daily snowice ice production 
     165      DO jj = 1, jpj 
     166         DO ji = 1, jpi 
     167            z2d(ji,jj) = ( tm_i(ji,jj) - rtt ) * zind(ji,jj) 
     168         END DO 
     169      END DO 
     170 
     171      CALL iom_put( "micet"       , z2d                  )        ! mean ice temperature 
     172      CALL iom_put( "icehc"       , et_i                 )        ! ice total heat content 
     173      CALL iom_put( "isnowhc"     , et_s                 )        ! snow total heat content 
     174      ! 
     175      z2d(:,:) = 0.e0 
     176      DO jl = 1, jpl 
     177         DO jj = 1, jpj 
     178            DO ji = 1, jpi 
     179               z2d(ji,jj) = z2d(ji,jj) + zind(ji,jj) * ( t_su(ji,jj,jl) - rtt ) * a_i(ji,jj,jl) / MAX( at_i(ji,jj) , epsi06 ) 
     180            END DO 
     181         END DO 
     182      END DO 
     183      CALL iom_put( "icest"       , z2d                 )        ! ice surface temperature 
     184      CALL iom_put( "sfxthd"      , sfx_thd * rday      )        ! equivalent FW salt flux 
     185      CALL iom_put( "ibrinv"      , bv_i * 100._wp      )        ! brine volume 
     186      DO jj = 1, jpj 
     187         DO ji = 1, jpi 
    228188            zindb  = MAX( zzero , SIGN( zone , at_i(ji,jj) ) ) 
    229  
    230             zcmo(ji,jj,1)  = at_i(ji,jj) 
    231             zcmo(ji,jj,2)  = vt_i(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zinda 
    232             zcmo(ji,jj,3)  = vt_s(ji,jj) / MAX( at_i(ji,jj), epsi06 ) * zinda 
    233             zcmo(ji,jj,4)  = diag_bot_gr(ji,jj) * rday     ! Bottom thermodynamic ice production 
    234             zcmo(ji,jj,5)  = diag_dyn_gr(ji,jj) * rday     ! Dynamic ice production (rid/raft) 
    235             zcmo(ji,jj,22) = diag_lat_gr(ji,jj) * rday     ! Lateral thermodynamic ice production 
    236             zcmo(ji,jj,23) = diag_sni_gr(ji,jj) * rday     ! Snow ice production ice production 
    237             zcmo(ji,jj,24) = (tm_i(ji,jj) - rtt) * zinda 
    238  
    239             zcmo(ji,jj,6)  = fbif(ji,jj)*at_i(ji,jj) 
    240             zcmo(ji,jj,7)  = (  u_ice(ji,jj) * tmu(ji,jj) + u_ice(ji-1,jj) * tmu(ji-1,jj) ) * 0.5_wp 
    241             zcmo(ji,jj,8)  = (  v_ice(ji,jj) * tmv(ji,jj) + v_ice(ji,jj-1) * tmv(ji,jj-1) ) * 0.5_wp 
    242             zcmo(ji,jj,9)  = sst_m(ji,jj) 
    243             zcmo(ji,jj,10) = sss_m(ji,jj) 
    244  
    245             zcmo(ji,jj,11) = qns(ji,jj) + qsr(ji,jj) 
    246             zcmo(ji,jj,12) = qsr(ji,jj) 
    247             zcmo(ji,jj,13) = qns(ji,jj) 
    248             zcmo(ji,jj,14) = fhbri(ji,jj) 
    249             zcmo(ji,jj,15) = utau_ice(ji,jj) 
    250             zcmo(ji,jj,16) = vtau_ice(ji,jj) 
    251             zcmo(ji,jj,17) = zcmo(ji,jj,17) + ( 1._wp - at_i(ji,jj) ) * qsr(ji,jj) 
    252             zcmo(ji,jj,18) = zcmo(ji,jj,18) + ( 1._wp - at_i(ji,jj) ) * qns(ji,jj) 
    253             zcmo(ji,jj,19) = sprecip(ji,jj) 
    254             zcmo(ji,jj,20) = smt_i(ji,jj) 
    255             zcmo(ji,jj,25) = et_i(ji,jj) 
    256             zcmo(ji,jj,26) = et_s(ji,jj) 
    257             zcmo(ji,jj,28) = sfx_bri(ji,jj) 
    258             zcmo(ji,jj,29) = sfx_thd(ji,jj) 
    259  
    260             zcmo(ji,jj,30) = bv_i(ji,jj) 
    261             zcmo(ji,jj,31) = hicol(ji,jj) * zindb 
    262             zcmo(ji,jj,32) = strength(ji,jj) 
    263             zcmo(ji,jj,33) = SQRT(  zcmo(ji,jj,7)*zcmo(ji,jj,7) + zcmo(ji,jj,8)*zcmo(ji,jj,8)  ) 
    264             zcmo(ji,jj,34) = diag_sur_me(ji,jj) * rday     ! Surface melt 
    265             zcmo(ji,jj,35) = diag_bot_me(ji,jj) * rday     ! Bottom melt 
    266             zcmo(ji,jj,36) = divu_i(ji,jj) 
    267             zcmo(ji,jj,37) = shear_i(ji,jj) 
    268             zcmo(ji,jj,38) = diag_res_pr(ji,jj) * rday     ! Bottom melt 
    269             zcmo(ji,jj,39) = vt_i(ji,jj)  ! ice volume 
    270             zcmo(ji,jj,40) = vt_s(ji,jj)  ! snow volume 
    271  
    272             zcmo(ji,jj,41) = sfx_mec(ji,jj) 
    273             zcmo(ji,jj,42) = sfx_res(ji,jj) 
    274  
    275             zcmo(ji,jj,43) = diag_trp_vi(ji,jj) * rday     ! transport of ice volume 
    276  
    277         END DO 
    278       END DO 
    279  
    280       ! 
    281       ! ecriture d'un fichier netcdf 
    282       ! 
    283       niter = niter + 1 
    284 !clem 
    285 !      DO jf = 1 , noumef 
    286 !         ! 
    287 !         zfield(:,:) = zcmo(:,:,jf) * cmulti(jf) + cadd(jf) 
    288 !         ! 
    289 !         IF( jf == 7  .OR. jf == 8  .OR. jf == 15 .OR. jf == 16 ) THEN   ;   CALL lbc_lnk( zfield, 'T', -1. ) 
    290 !         ELSE                                                            ;   CALL lbc_lnk( zfield, 'T',  1. ) 
    291 !         ENDIF 
    292 !         ! 
    293 !         IF( ln_nicep ) THEN  
    294 !            WRITE(numout,*) 
    295 !            WRITE(numout,*) 'nc(jf), nice, nam(jf), niter, ndim' 
    296 !            WRITE(numout,*) nc(jf), nice, nam(jf), niter, ndim 
    297 !         ENDIF 
    298 !         IF( nc(jf) == 1 ) CALL histwrite( nice, nam(jf), niter, zfield, ndim, ndex51 ) 
    299 !         ! 
    300 !      END DO 
    301 ! 
    302 !      IF( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN 
    303 !         IF( lwp) WRITE(numout,*) ' Closing the icemod file ' 
    304 !         CALL histclo( nice ) 
    305 !      ENDIF 
    306 !clem 
    307       ! 
    308        CALL iom_put ('iceconc', zcmo(:,:,1) )          ! field1: ice concentration 
    309        CALL iom_put ('icethic_cea', zcmo(:,:,2) )      ! field2: ice thickness (i.e. icethi(:,:)) 
    310        CALL iom_put ('snowthic_cea', zcmo(:,:,3))      ! field3: snow thickness 
    311        CALL iom_put ('icebopr', zcmo(:,:,4) )   ! field4: daily bottom thermo ice production 
    312        CALL iom_put ('icedypr', zcmo(:,:,5) )   ! field5: daily dynamic ice production 
    313        CALL iom_put ('ioceflxb', zcmo(:,:,6) )         ! field6: Oceanic flux at the ice base 
    314        CALL iom_put ('uice_ipa', zcmo(:,:,7) )         ! field7: ice velocity u component 
    315        CALL iom_put ('vice_ipa', zcmo(:,:,8) )         ! field8: ice velocity v component 
    316        CALL iom_put ('isst', zcmo(:,:,9) )             ! field 9: sea surface temperature 
    317        CALL iom_put ('isss', zcmo(:,:,10) )            ! field 10: sea surface salinity 
    318        CALL iom_put ('qt_oce', zcmo(:,:,11) )           ! field 11: total flux at ocean surface 
    319        CALL iom_put ('qsr_oce', zcmo(:,:,12) )          ! field 12: solar flux at ocean surface 
    320        CALL iom_put ('qns_oce', zcmo(:,:,13) )          ! field 13: non-solar flux at ocean surface 
    321        !CALL iom_put ('hfbri', fhbri )                  ! field 14: heat flux due to brine release 
    322        CALL iom_put( 'utau_ice', zcmo(:,:,15)  )     ! Wind stress over ice along i-axis at I-point 
    323        CALL iom_put( 'vtau_ice', zcmo(:,:,16) )     ! Wind stress over ice along j-axis at I-point 
    324        CALL iom_put ('qsr_io', zcmo(:,:,17) )          ! field 17: solar flux at ice/ocean surface 
    325        CALL iom_put ('qns_io', zcmo(:,:,18) )          ! field 18: non-solar flux at ice/ocean surface 
    326        !CALL iom_put ('snowpre', zcmo(:,:,19) * rday ! field 19 :snow precip           
    327        CALL iom_put ('micesalt', zcmo(:,:,20) )        ! field 20 :mean ice salinity 
    328        CALL iom_put ('miceage', zcmo(:,:,21) / 365)    ! field 21: mean ice age 
    329        CALL iom_put ('icelapr',zcmo(:,:,22) )   ! field 22: daily lateral thermo ice prod. 
    330        CALL iom_put ('icesipr',zcmo(:,:,23) )   ! field 23: daily snowice ice prod. 
    331        CALL iom_put ('micet', zcmo(:,:,24) )           ! field 24: mean ice temperature 
    332        CALL iom_put ('icehc', zcmo(:,:,25) )           ! field 25: ice total heat content 
    333        CALL iom_put ('isnowhc', zcmo(:,:,26) )         ! field 26: snow total heat content 
    334        CALL iom_put ('icest', zcmo(:,:,27) )           ! field 27: ice surface temperature 
    335        CALL iom_put ('sfxbri', zcmo(:,:,28) * rday )           ! field 28: brine salt flux 
    336        CALL iom_put ('sfxthd', zcmo(:,:,29) * rday )           ! field 29: equivalent FW salt flux 
    337        CALL iom_put ('ibrinv', zcmo(:,:,30) *100 )     ! field 30: brine volume 
    338        CALL iom_put ('icecolf', zcmo(:,:,31) )         ! field 31: frazil ice collection thickness 
    339        CALL iom_put ('icestr', zcmo(:,:,32) * 0.001 )  ! field 32: ice strength 
    340        CALL iom_put ('icevel', zcmo(:,:,33) )          ! field 33: ice velocity 
    341        CALL iom_put ('isume', zcmo(:,:,34) )    ! field 34: surface melt 
    342        CALL iom_put ('ibome', zcmo(:,:,35) )     ! field 35: bottom melt 
    343        CALL iom_put ('idive', zcmo(:,:,36) * 1.0e8)    ! field 36: divergence 
    344        CALL iom_put ('ishear', zcmo(:,:,37) * 1.0e8 )  ! field 37: shear 
    345        CALL iom_put ('icerepr', zcmo(:,:,38) ) ! field 38: daily prod./melting due to limupdate 
    346        CALL iom_put ('icevolu', zcmo(:,:,39) ) ! field 39: ice volume 
    347        CALL iom_put ('snowvol', zcmo(:,:,40) ) ! field 40: snow volume 
    348        CALL iom_put ('sfxmec', zcmo(:,:,41) * rday )           ! field 41: salt flux from ridging rafting 
    349        CALL iom_put ('sfxres', zcmo(:,:,42) * rday )           ! field 42: salt flux from limupdate (resultant) 
    350        CALL iom_put ('icetrp', zcmo(:,:,43) )    ! field 43: ice volume transport 
    351  
    352       !----------------------------- 
    353       ! Thickness distribution file 
    354       !----------------------------- 
    355       IF( add_diag_swi == 1 ) THEN 
     189            z2d(ji,jj) = hicol(ji,jj) * zindb 
     190         END DO 
     191      END DO 
     192      CALL iom_put( "icecolf"     , z2d                 )        ! frazil ice collection thickness 
     193      CALL iom_put( "icestr"      , strength * 0.001    )        ! ice strength 
     194      CALL iom_put( "isume"       , diag_sur_me * rday  )        ! surface melt  
     195      CALL iom_put( "ibome"       , diag_bot_me * rday  )        ! bottom melt  
     196      CALL iom_put( "idive"       , divu_i * 1.0e8      )        ! divergence 
     197      CALL iom_put( "ishear"      , shear_i * 1.0e8     )        ! shear 
     198      CALL iom_put( "isume"       , diag_sur_me * rday  )        ! surface melt  
     199      CALL iom_put( "icerepr"     , diag_res_pr * rday  )        ! daily prod./melting due to limupdate  
     200      CALL iom_put( "snowvol"     , vt_s                )        ! snow volume 
     201      CALL iom_put( "sfxmec"      , sfx_mec * rday      )        ! salt flux from ridging rafting 
     202      CALL iom_put( "sfxres"      , sfx_res * rday      )        ! salt flux from limupdate (resultant) 
     203      CALL iom_put( "icetrp"      , diag_trp_vi * rday  )        ! ice volume transport 
     204 
     205 
     206      !-------------------------------- 
     207      ! Output values for each category 
     208      !-------------------------------- 
    356209 
    357210         DO jl = 1, jpl  
     
    363216         END DO 
    364217 
    365          ! Compute ice age 
    366218         DO jl = 1, jpl  
    367219            DO jj = 1, jpj 
     
    372224            END DO 
    373225         END DO 
     226  
     227         CALL iom_put( "iceage_cat"     , zoi         )        ! ice age for categories 
    374228 
    375229         ! Compute brine volume 
     
    392246         END DO 
    393247 
    394          CALL histwrite( nicea, "iice_itd", niter, a_i  , ndimitd , ndexitd  )   ! area 
    395          CALL histwrite( nicea, "iice_hid", niter, ht_i , ndimitd , ndexitd  )   ! thickness 
    396          CALL histwrite( nicea, "iice_hsd", niter, ht_s , ndimitd , ndexitd  )   ! snow depth 
    397          CALL histwrite( nicea, "iice_std", niter, sm_i , ndimitd , ndexitd  )   ! salinity 
    398          CALL histwrite( nicea, "iice_otd", niter, zoi  , ndimitd , ndexitd  )   ! age 
    399          CALL histwrite( nicea, "iice_etd", niter, zei  , ndimitd , ndexitd  )   ! brine volume 
    400  
    401          !     !  Create an output files (output.lim.abort.nc) if S < 0 or u > 20 m/s 
    402          !     IF( kindic < 0 )   CALL lim_wri_state( 'output.abort' ) 
    403          !     not yet implemented 
    404  
    405          IF( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN 
    406             IF(lwp) WRITE(numout,*) ' Closing the icemod file ' 
    407             CALL histclo( nicea )  
    408          ENDIF 
    409          ! 
    410       ENDIF 
    411  
    412       CALL wrk_dealloc( jpi, jpj, zfield ) 
    413       CALL wrk_dealloc( jpi, jpj, jpnoumax, zcmo, zcmoa ) 
    414       CALL wrk_dealloc( jpi, jpj, jpl, zmaskitd, zoi, zei ) 
     248         CALL iom_put( "iceconc_cat"      , a_i         )        ! area for categories 
     249         CALL iom_put( "icethic_cat"      , ht_i        )        ! thickness for categories 
     250         CALL iom_put( "snowthic_cat"     , ht_s        )        ! snow depth for categories 
     251         CALL iom_put( "salinity_cat"     , sm_i        )        ! salinity for categories 
     252         CALL iom_put( "brinevol_cat"     , zei         )        ! brine volume for categories 
     253 
     254      !     !  Create an output files (output.lim.abort.nc) if S < 0 or u > 20 
     255      !     m/s 
     256      !     IF( kindic < 0 )   CALL lim_wri_state( 'output.abort' ) 
     257      !     not yet implemented 
     258 
     259      CALL wrk_dealloc( jpi, jpj, jpl, zoi, zei ) 
     260      CALL wrk_dealloc( jpi, jpj     , z2d, zind, z2da, z2db ) 
    415261 
    416262      IF( nn_timing == 1 )  CALL timing_stop('limwri') 
     
    419265#endif 
    420266 
    421    SUBROUTINE lim_wri_init 
    422       !!------------------------------------------------------------------- 
    423       !!                    ***   ROUTINE lim_wri_init  *** 
    424       !!                 
    425       !! ** Purpose :   ??? 
    426       !! 
    427       !! ** Method  : Read the namicewri namelist and check the parameter  
    428       !!       values called at the first timestep (nit000) 
    429       !! 
    430       !! ** input   :   Namelist namicewri 
    431       !!------------------------------------------------------------------- 
    432       INTEGER ::   nf      ! ??? 
    433  
    434       TYPE FIELD  
    435          CHARACTER(len = 35) :: ztitle  
    436          CHARACTER(len = 8 ) :: zname           
    437          CHARACTER(len = 8 ) :: zunit 
    438          INTEGER             :: znc    
    439          REAL                :: zcmulti  
    440          REAL                :: zcadd         
    441       END TYPE FIELD 
    442  
    443       TYPE(FIELD) ::  & 
    444          field_1 , field_2 , field_3 , field_4 , field_5 , field_6 ,   & 
    445          field_7 , field_8 , field_9 , field_10, field_11, field_12,   & 
    446          field_13, field_14, field_15, field_16, field_17, field_18,   & 
    447          field_19, field_20, field_21, field_22, field_23, field_24,   & 
    448          field_25, field_26, field_27, field_28, field_29, field_30,   & 
    449          field_31, field_32, field_33, field_34, field_35, field_36,   & 
    450          field_37, field_38, field_39, field_40, field_41, field_42, field_43 
    451  
    452       TYPE(FIELD) , DIMENSION(jpnoumax) :: zfield 
    453       ! 
    454       NAMELIST/namiceout/ noumef, & 
    455          field_1 , field_2 , field_3 , field_4 , field_5 , field_6 ,   & 
    456          field_7 , field_8 , field_9 , field_10, field_11, field_12,   & 
    457          field_13, field_14, field_15, field_16, field_17, field_18,   & 
    458          field_19, field_20, field_21, field_22, field_23, field_24,   & 
    459          field_25, field_26, field_27, field_28, field_29, field_30,   & 
    460          field_31, field_32, field_33, field_34, field_35, field_36,   & 
    461          field_37, field_38, field_39, field_40, field_41, field_42, field_43, add_diag_swi 
    462       !!------------------------------------------------------------------- 
    463  
    464       REWIND( numnam_ice )                ! Read Namelist namicewri 
    465       READ  ( numnam_ice  , namiceout ) 
    466  
    467       zfield(1)  = field_1 
    468       zfield(2)  = field_2 
    469       zfield(3)  = field_3 
    470       zfield(4)  = field_4 
    471       zfield(5)  = field_5 
    472       zfield(6)  = field_6 
    473       zfield(7)  = field_7 
    474       zfield(8)  = field_8 
    475       zfield(9)  = field_9 
    476       zfield(10) = field_10 
    477       zfield(11) = field_11 
    478       zfield(12) = field_12 
    479       zfield(13) = field_13 
    480       zfield(14) = field_14 
    481       zfield(15) = field_15 
    482       zfield(16) = field_16 
    483       zfield(17) = field_17 
    484       zfield(18) = field_18 
    485       zfield(19) = field_19 
    486       zfield(20) = field_20 
    487       zfield(21) = field_21 
    488       zfield(22) = field_22 
    489       zfield(23) = field_23 
    490       zfield(24) = field_24 
    491       zfield(25) = field_25 
    492       zfield(26) = field_26 
    493       zfield(27) = field_27 
    494       zfield(28) = field_28 
    495       zfield(29) = field_29 
    496       zfield(30) = field_30 
    497       zfield(31) = field_31 
    498       zfield(32) = field_32 
    499       zfield(33) = field_33 
    500       zfield(34) = field_34 
    501       zfield(35) = field_35 
    502       zfield(36) = field_36 
    503       zfield(37) = field_37 
    504       zfield(38) = field_38 
    505       zfield(39) = field_39 
    506       zfield(40) = field_40 
    507       zfield(41) = field_41 
    508       zfield(42) = field_42 
    509       zfield(43) = field_43 
    510  
    511       DO nf = 1, noumef 
    512          titn  (nf) = zfield(nf)%ztitle 
    513          nam   (nf) = zfield(nf)%zname 
    514          uni   (nf) = zfield(nf)%zunit 
    515          nc    (nf) = zfield(nf)%znc 
    516          cmulti(nf) = zfield(nf)%zcmulti 
    517          cadd  (nf) = zfield(nf)%zcadd 
    518       END DO 
    519  
    520       IF(lwp) THEN                        ! control print 
    521          WRITE(numout,*) 
    522          WRITE(numout,*) 'lim_wri_init : Ice parameters for outputs' 
    523          WRITE(numout,*) '~~~~~~~~~~~~' 
    524          WRITE(numout,*) '    number of fields to be stored         noumef = ', noumef 
    525          WRITE(numout,*) '           title                            name     unit      Saving (1/0) ',   & 
    526             &            '    multiplicative constant       additive constant ' 
    527          DO nf = 1 , noumef          
    528             WRITE(numout,*) '   ', titn(nf), '   '    , nam   (nf), '      '  , uni (nf),   & 
    529                &            '  ' , nc  (nf),'        ', cmulti(nf), '        ', cadd(nf) 
    530          END DO 
    531          WRITE(numout,*) ' add_diag_swi ', add_diag_swi 
    532       ENDIF 
    533       ! 
    534    END SUBROUTINE lim_wri_init 
    535267  
    536268   SUBROUTINE lim_wri_state( kt, kid, kh_i ) 
     
    549281      INTEGER, INTENT( in ) ::   kid , kh_i        
    550282      !!---------------------------------------------------------------------- 
    551       !CALL histvert( kid, "icethi", "L levels","m", jpl , hi_mean , nz ) 
    552  
     283     
     284 
     285     
    553286      CALL histdef( kid, "iicethic", "Ice thickness"           , "m"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    554287      CALL histdef( kid, "iiceconc", "Ice concentration"       , "%"      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
     
    575308      CALL histdef( kid, "iisfxres", "Salt flux from limupdate", ""      , jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
    576309 
    577  
    578       !CALL histdef( kid, "iice_itd", "Ice concentration by cat", "%"      , jpi, jpj, kh_i, jpl, 1, jpl, -99, 32, "inst(x)", rdt, rdt )  
    579       !CALL histdef( kid, "iice_hid", "Ice thickness by cat"    , "m"      , jpi, jpj, kh_i, jpl, 1, jpl, -99, 32, "inst(x)", rdt, rdt )  
    580       !CALL histdef( kid, "iice_hsd", "Snow thickness by cat"   , "m"      , jpi, jpj, kh_i, jpl, 1, jpl, -99, 32, "inst(x)", rdt, rdt )  
    581       !CALL histdef( kid, "iice_std", "Ice salinity by cat"     , "PSU"    , jpi, jpj, kh_i, jpl, 1, jpl, -99, 32, "inst(x)", rdt, rdt )  
    582  
    583310      CALL histend( kid, snc4set )   ! end of the file definition 
    584311 
     
    608335      CALL histwrite( kid, "iisfxres", kt, sfx_res        , jpi*jpj, (/1/) ) 
    609336 
    610       !CALL histwrite( kid, "iice_itd", kt, a_i  , jpi*jpj*jpl, (/1/)  )   ! area 
    611       !CALL histwrite( kid, "iice_hid", kt, ht_i , jpi*jpj*jpl, (/1/)  )   ! thickness 
    612       !CALL histwrite( kid, "iice_hsd", kt, ht_s , jpi*jpj*jpl, (/1/)  )   ! snow depth 
    613       !CALL histwrite( kid, "iice_std", kt, sm_i , jpi*jpj*jpl, (/1/)  )   ! salinity 
     337      ! Close the file 
     338      ! ----------------- 
     339      CALL histclo( kid ) 
    614340 
    615341    END SUBROUTINE lim_wri_state 
  • branches/dev_r4028_CNRS_LIM3_MV2014/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r4345 r4525  
    3232   USE trc_oce, ONLY :   nn_dttrc        !  !: frequency of step on passive tracers 
    3333   USE icb_oce, ONLY :   class_num       !  !: iceberg classes 
     34   USE par_ice 
    3435   USE domngb          ! ocean space and time domain 
    3536   USE phycst          ! physical constants 
     
    131132      CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,nfloat) /) ) 
    132133# endif 
     134      CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) ) 
    133135      CALL iom_set_axis_attr( "icbcla", class_num ) 
    134136       
Note: See TracChangeset for help on using the changeset viewer.