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 508 for trunk/NEMO/LIM_SRC/limwri.F90 – NEMO

Ignore:
Timestamp:
2006-10-03T17:58:55+02:00 (18 years ago)
Author:
opalod
Message:

nemo_v1_update_071:RB: add iom for restart and reorganization of restart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/LIM_SRC/limwri.F90

    r352 r508  
    44   !!         Ice diagnostics :  write ice output files 
    55   !!====================================================================== 
    6    !!---------------------------------------------------------------------- 
    7    !!  LIM 2.0, UCL-LOCEAN-IPSL (2005) 
    8    !! $Header$ 
    9    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
    10    !!---------------------------------------------------------------------- 
     6   !! history :  2.0  ! 03-08  (C. Ethe) original code 
     7   !!            2.0  ! 04-10  (C. Ethe )  1D configuration 
     8   !!------------------------------------------------------------------- 
    119#if defined key_ice_lim 
    1210   !!---------------------------------------------------------------------- 
    1311   !!   'key_ice_lim'                                     LIM sea-ice model 
     12   !!---------------------------------------------------------------------- 
    1413   !!---------------------------------------------------------------------- 
    1514   !!   lim_wri      : write of the diagnostics variables in ouput file  
    1615   !!   lim_wri_init : initialization and namelist read 
    1716   !!---------------------------------------------------------------------- 
    18    !! * Modules used 
    1917   USE ioipsl 
    2018   USE dianam    ! build name of file (routine) 
     
    2725   USE dom_ice 
    2826   USE ice 
    29    USE iceini 
    3027   USE lbclnk 
    3128 
     
    3330   PRIVATE 
    3431 
    35    !! * Accessibility 
    36    PUBLIC lim_wri        ! routine called by lim_step.F90 
    37  
    38    !! * Module variables 
    39    INTEGER, PARAMETER ::   &  !: 
    40       jpnoumax = 40             !: maximum number of variable for ice output 
    41    INTEGER  ::                                & 
    42       noumef                                     ! number of fields 
    43    REAL(wp)           , DIMENSION(jpnoumax) ::  & 
    44       cmulti ,                                &  ! multiplicative constant 
    45       cadd                                       ! additive constant 
    46    CHARACTER(len = 35), DIMENSION(jpnoumax) ::  & 
    47       titn                                       ! title of the field 
    48    CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::  & 
    49       nam                                        ! name of the field 
    50    CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::  & 
    51       uni                                        ! unit of the field 
    52    INTEGER            , DIMENSION(jpnoumax) ::  & 
    53       nc                                         ! switch for saving field ( = 1 ) or not ( = 0 ) 
     32   PUBLIC   lim_wri        ! routine called by lim_step.F90 
     33 
     34   INTEGER, PARAMETER                       ::   jpnoumax = 40   ! maximum number of variable for ice output 
     35   INTEGER                                  ::   noumef          ! number of fields 
     36   REAL(wp)           , DIMENSION(jpnoumax) ::   cmulti ,     &  ! multiplicative constant 
     37      &                                          cadd            ! additive constant 
     38   CHARACTER(len = 35), DIMENSION(jpnoumax) ::   titn            ! title of the field 
     39   CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::   nam             ! name of the field 
     40   CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::   uni             ! unit of the field 
     41   INTEGER            , DIMENSION(jpnoumax) ::   nc              ! switch for saving field ( = 1 ) or not ( = 0 ) 
     42 
     43   INTEGER ::   nice, nhorid, ndim, niter, ndepid       ! ???? 
     44   INTEGER , DIMENSION( jpij ) ::   ndex51              ! ???? 
    5445 
    5546   REAL(wp)  ::            &  ! constant values 
     
    5748      zzero  = 0.e0     ,  & 
    5849      zone   = 1.e0 
    59    !!------------------------------------------------------------------- 
     50 
     51   !!---------------------------------------------------------------------- 
     52   !!  LIM 2.0, UCL-LOCEAN-IPSL (2005) 
     53   !! $Header$ 
     54   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     55   !!---------------------------------------------------------------------- 
    6056 
    6157CONTAINS 
     58 
    6259#if defined key_dimgout 
    63  
     60   !!---------------------------------------------------------------------- 
     61   !!   'key_dimgout'                                    Direct Access file 
     62   !!---------------------------------------------------------------------- 
    6463# include "limwri_dimg.h90" 
    65  
    6664#else 
    67  
    68    SUBROUTINE lim_wri 
    69       !!------------------------------------------------------------------- 
    70       !!  This routine computes the average of some variables and write it 
    71       !!  on the ouput files. 
    72       !!  ATTENTION cette routine n'est valable que si le pas de temps est 
    73       !!  egale a une fraction entiere de 1 jours. 
    74       !!  Diff 1-D 3-D : suppress common also included in etat 
    75       !!                 suppress cmoymo 11-18 
    76       !!  modif : 03/06/98 
    77       !!------------------------------------------------------------------- 
    78       !! * Local variables 
    79       REAL(wp),DIMENSION(1) ::   zdept 
    80        
    81       REAL(wp) :: & 
    82          zsto, zsec, zjulian,zout, & 
    83          zindh,zinda,zindb,  & 
    84          ztmu 
    85       REAL(wp), DIMENSION(jpi,jpj,jpnoumax) :: & 
    86          zcmo 
    87       REAL(wp), DIMENSION(jpi,jpj) ::  & 
    88          zfield 
    89       INTEGER ::  ji, jj, jf   ! dummy loop indices 
    90  
    91       CHARACTER(len = 40)  :: & 
    92          clhstnam, clop 
    93  
    94       INTEGER , SAVE ::      & 
    95          nice, nhorid, ndim, niter, ndepid 
    96       INTEGER , DIMENSION( jpij ) , SAVE ::  & 
    97          ndex51   
    98       !!------------------------------------------------------------------- 
    99        
    100       IF ( numit == nstart ) THEN  
    101  
     65   !!---------------------------------------------------------------------- 
     66   !!   Default option                                          NetCDF file 
     67   !!---------------------------------------------------------------------- 
     68 
     69   SUBROUTINE lim_wri( kt ) 
     70      !!------------------------------------------------------------------- 
     71      !!                    ***   ROUTINE lim_wri  *** 
     72      !!                 
     73      !! ** Purpose :   write the sea-ice output file in NetCDF 
     74      !! 
     75      !! ** Method  :   computes the average of some variables and write 
     76      !!      it in the NetCDF ouput files 
     77      !!      CAUTION: the sea-ice time-step must be an integer fraction 
     78      !!      of a day 
     79      !!------------------------------------------------------------------- 
     80      INTEGER, INTENT(in) ::   kt     ! number of iteration 
     81 
     82      INTEGER  ::   ji, jj, jf                      ! dummy loop indices 
     83      CHARACTER(len = 40)  ::   clhstnam, clop 
     84      REAL(wp) ::   zsto, zsec, zjulian, zout,   &  ! temporary scalars 
     85         &          zindh, zinda, zindb, ztmu 
     86      REAL(wp), DIMENSION(1)                ::   zdept 
     87      REAL(wp), DIMENSION(jpi,jpj)          ::   zfield 
     88      REAL(wp), DIMENSION(jpi,jpj,jpnoumax) ::   zcmo 
     89      !!------------------------------------------------------------------- 
     90 
     91      !                                          !--------------------! 
     92      IF ( kt == nit000 ) THEN                !   Initialisation   ! 
     93         !                                       !--------------------! 
    10294         CALL lim_wri_init  
    103           
    104          !---5----|----5----|----5----|----5----|----5----|----5----|----5----|72 
    105          !  1) INITIALIZATIONS.                                                 | 
    106          !----------------------------------------------------------------------- 
    107           
    108          !-- essai NetCDF 
    109           
     95                            
    11096         zsto     = rdt_ice 
    11197!!Chris         clop     = "ave(only(x))"      !ibug  namelist parameter a ajouter 
     
    118104         CALL ymds2ju ( nyear, nmonth, nday, zsec, zjulian ) 
    119105         CALL dia_nam ( clhstnam, nwrite, 'icemod' ) 
    120          CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit, 1, jpi, 1, jpj, 0, zjulian, rdt_ice, nhorid, nice , domain_id=nidom) 
     106         CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit,    & 
     107            &           1, jpi, 1, jpj, 0, zjulian, rdt_ice, nhorid, nice , domain_id=nidom) 
    121108         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid) 
    122109         CALL wheneq  ( jpij , tmask(:,:,1), 1, 1., ndex51, ndim) 
    123110          
    124111         DO jf = 1, noumef 
    125             IF ( nc(jf) == 1 ) THEN 
    126                CALL histdef( nice, nam(jf), titn(jf), uni(jf), jpi, jpj   & 
    127                   , nhorid, 1, 1, 1, -99, 32, clop, zsto, zout ) 
    128             ENDIF 
    129          END DO 
    130          CALL histend(nice) 
    131           
    132       ENDIF 
    133        
    134       !---5----|----5----|----5----|----5----|----5----|----5----|----5----|72 
    135       !--2. Computation of instantaneous values                                         | 
    136       !----------------------------------------------------------------------- 
    137  
     112            IF ( nc(jf) == 1 )   CALL histdef( nice, nam(jf), titn(jf), uni(jf), jpi, jpj   & 
     113                  &                                , nhorid, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     114         END DO 
     115         CALL histend( nice ) 
     116          
     117      ENDIF 
     118      !                                          !--------------------! 
     119      !                                          !   Cumulate at kt   ! 
     120      !                                          !--------------------! 
     121 
     122!!gm  change the print below to have it only at output time step or when nitend =< 100 
    138123      IF(lwp) THEN 
    139124         WRITE(numout,*) 
    140          WRITE(numout,*) 'lim_wri : write ice outputs in NetCDF files at time : ', nyear, nmonth, nday, numit 
     125         WRITE(numout,*) 'lim_wri : write ice outputs in NetCDF files at time : ', nyear, nmonth, nday, kt + nfice - 1 
    141126         WRITE(numout,*) '~~~~~~~ ' 
    142127      ENDIF 
     
    179164         END DO 
    180165      END DO 
    181                  
    182166      ! 
    183       ! ecriture d'un fichier netcdf 
     167      ! Write the netcdf file 
    184168      ! 
    185169      niter = niter + 1 
     
    205189         CALL histclo( nice )  
    206190      ENDIF 
    207        
     191      ! 
    208192   END SUBROUTINE lim_wri 
     193    
    209194#endif 
    210195    
     
    213198      !!                    ***   ROUTINE lim_wri_init  *** 
    214199      !!                 
    215       !! ** Purpose :   ??? 
     200      !! ** Purpose :   intialisation of LIM sea-ice output 
    216201      !! 
    217202      !! ** Method  : Read the namicewri namelist and check the parameter  
     
    219204      !! 
    220205      !! ** input   :   Namelist namicewri 
    221       !! 
    222       !! history : 
    223       !!  8.5  ! 03-08 (C. Ethe) original code 
    224       !!------------------------------------------------------------------- 
    225       !! * Local declarations 
     206      !!------------------------------------------------------------------- 
    226207      INTEGER ::   nf      ! ??? 
    227  
    228208      TYPE FIELD  
    229209         CHARACTER(len = 35) :: ztitle  
     
    234214         REAL                :: zcadd         
    235215      END TYPE FIELD 
    236  
    237216      TYPE(FIELD) ::  & 
    238217         field_1 , field_2 , field_3 , field_4 , field_5 , field_6 ,   & 
     
    240219         field_13, field_14, field_15, field_16, field_17, field_18,   & 
    241220         field_19 
    242  
    243221      TYPE(FIELD) , DIMENSION(jpnoumax) :: zfield 
    244222 
     
    248226         field_13, field_14, field_15, field_16, field_17, field_18,   & 
    249227         field_19 
    250       !!------------------------------------------------------------------- 
    251  
     228!!gm      NAMELIST/namiceout/ noumef, & 
     229!!           zfield( 1), zfield( 2), zfield( 3), zfield( 4), zfield( 5),   & 
     230!!           zfield( 6), zfield( 7), zfield( 8), zfield( 9), zfield(10),   & 
     231!!           zfield(11), zfield(12), zfield(13), zfield(14), zfield(15),   & 
     232!!gm         zfield(16), zfield(17), zfield(18), zfield(19) 
     233      !!------------------------------------------------------------------- 
    252234 
    253235      ! Read Namelist namicewri 
    254236      REWIND ( numnam_ice ) 
    255237      READ   ( numnam_ice  , namiceout ) 
     238       
    256239      zfield(1)  = field_1 
    257240      zfield(2)  = field_2 
     
    295278         END DO 
    296279      ENDIF 
    297              
     280      !     
    298281   END SUBROUTINE lim_wri_init 
    299282 
Note: See TracChangeset for help on using the changeset viewer.