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 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (13 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    • Property svn:eol-style deleted
    r1792 r2528  
    44   !! Ocean diagnostics :  write ocean output files 
    55   !!===================================================================== 
    6  
    7    !!---------------------------------------------------------------------- 
    8    !! * Modules used 
     6   !! History :  OPA  ! 1991-03  (M.-A. Foujols)  Original code 
     7   !!            4.0  ! 1991-11  (G. Madec) 
     8   !!                 ! 1992-06  (M. Imbard)  correction restart file 
     9   !!                 ! 1992-07  (M. Imbard)  split into diawri and rstwri 
     10   !!                 ! 1993-03  (M. Imbard)  suppress writibm 
     11   !!                 ! 1998-01  (C. Levy)  NETCDF format using ioipsl INTERFACE 
     12   !!                 ! 1999-02  (E. Guilyardi)  name of netCDF files + variables 
     13   !!            8.2  ! 2000-06  (M. Imbard)  Original code (diabort.F) 
     14   !!   NEMO     1.0  ! 2002-06  (A.Bozec, E. Durand)  Original code (diainit.F) 
     15   !!             -   ! 2002-09  (G. Madec)  F90: Free form and module 
     16   !!             -   ! 2002-12  (G. Madec)  merge of diabort and diainit, F90 
     17   !!                 ! 2005-11  (V. Garnier) Surface pressure gradient organization 
     18   !!            3.2  ! 2008-11  (B. Lemaire) creation from old diawri 
     19   !!---------------------------------------------------------------------- 
     20 
     21   !!---------------------------------------------------------------------- 
     22   !!   dia_wri       : create the standart output files 
     23   !!   dia_wri_state : create an output NetCDF file for a single instantaeous ocean state and forcing fields 
     24   !!---------------------------------------------------------------------- 
    925   USE oce             ! ocean dynamics and tracers  
    1026   USE dom_oce         ! ocean space and time domain 
     
    3046   USE limwri_2  
    3147#endif 
     48   USE dtatem 
     49   USE dtasal 
     50 
    3251   IMPLICIT NONE 
    3352   PRIVATE 
    3453 
    35    !! * Accessibility 
    36    PUBLIC dia_wri                 ! routines called by step.F90 
    37    PUBLIC dia_wri_state 
    38  
    39    !! * Module variables 
    40    INTEGER ::   & 
    41       nid_T, nz_T, nh_T, ndim_T, ndim_hT,      &   ! grid_T file 
    42       nid_U, nz_U, nh_U, ndim_U, ndim_hU,      &   ! grid_U file 
    43       nid_V, nz_V, nh_V, ndim_V, ndim_hV,      &   ! grid_V file 
    44       nid_W, nz_W, nh_W,                       &   ! grid_W file 
    45       ndex(1)                                      ! ??? 
    46    INTEGER, DIMENSION(jpi*jpj) ::   & 
    47       ndex_hT, ndex_hU, ndex_hV 
    48    INTEGER, DIMENSION(jpi*jpj*jpk) ::   & 
    49       ndex_T, ndex_U, ndex_V 
     54   PUBLIC   dia_wri                 ! routines called by step.F90 
     55   PUBLIC   dia_wri_state 
     56 
     57   INTEGER ::   nid_T, nz_T, nh_T, ndim_T, ndim_hT   ! grid_T file 
     58   INTEGER ::   nid_U, nz_U, nh_U, ndim_U, ndim_hU   ! grid_U file 
     59   INTEGER ::   nid_V, nz_V, nh_V, ndim_V, ndim_hV   ! grid_V file 
     60   INTEGER ::   nid_W, nz_W, nh_W                    ! grid_W file 
     61   INTEGER ::   ndex(1)                              ! ??? 
     62   INTEGER, DIMENSION(jpi*jpj)     ::   ndex_hT, ndex_hU, ndex_hV 
     63   INTEGER, DIMENSION(jpi*jpj*jpk) ::   ndex_T, ndex_U, ndex_V 
    5064 
    5165   !! * Substitutions 
     
    5468#  include "vectopt_loop_substitute.h90" 
    5569   !!---------------------------------------------------------------------- 
    56    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    57    !! $Id$ 
    58    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    59    !!---------------------------------------------------------------------- 
    60  
     70   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     71   !! $Id $ 
     72   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     73   !!---------------------------------------------------------------------- 
    6174CONTAINS 
    6275 
    6376#if defined key_dimgout 
    6477   !!---------------------------------------------------------------------- 
    65    !!   dia_wri       : create the dimg direct access output file (mpp) 
     78   !!   'key_dimgout'                                      DIMG output file 
    6679   !!---------------------------------------------------------------------- 
    6780#   include "diawri_dimg.h90" 
     
    7184   !!   Default option                                   NetCDF output file 
    7285   !!---------------------------------------------------------------------- 
    73    !!   dia_wri       : create the standart NetCDF output files 
    74    !!   dia_wri_state : create an output NetCDF file for a single 
    75    !!                   instantaeous ocean state and forcing fields 
    76    !!---------------------------------------------------------------------- 
    7786# if defined key_iomput 
     87   !!---------------------------------------------------------------------- 
     88   !!   'key_iomput'                                        use IOM library 
     89   !!---------------------------------------------------------------------- 
    7890   SUBROUTINE dia_wri( kt ) 
    7991      !!--------------------------------------------------------------------- 
     
    8496      !! 
    8597      !! ** Method  :  use iom_put 
    86       !! 
    87       !! History : 
    88       !!   3.2  !  05-11  (B. Lemaire) creation from old diawri 
    8998      !!---------------------------------------------------------------------- 
    9099      USE oce, ONLY :   z3d => ta   ! use ta as 3D workspace 
     
    165174         CALL iom_put( "v_heattr", z2d )                  !  heat transport in i-direction 
    166175      ENDIF 
    167  
     176      ! 
    168177   END SUBROUTINE dia_wri 
    169178 
    170179#else 
     180   !!---------------------------------------------------------------------- 
     181   !!   Default option                                  use IOIPSL  library 
     182   !!---------------------------------------------------------------------- 
     183 
    171184   SUBROUTINE dia_wri( kt ) 
    172185      !!--------------------------------------------------------------------- 
     
    180193      !!      At each time step call histdef to compute the mean if ncessary 
    181194      !!      Each nwrite time step, output the instantaneous or mean fields 
     195      !!---------------------------------------------------------------------- 
     196      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    182197      !! 
    183       !! History : 
    184       !!        !  91-03  (M.-A. Foujols)  Original code 
    185       !!        !  91-11  (G. Madec) 
    186       !!        !  92-06  (M. Imbard)  correction restart file 
    187       !!        !  92-07  (M. Imbard)  split into diawri and rstwri 
    188       !!        !  93-03  (M. Imbard)  suppress writibm 
    189       !!        !  98-01  (C. Levy)  NETCDF format using ioipsl INTERFACE 
    190       !!        !  99-02  (E. Guilyardi)  name of netCDF files + variables 
    191       !!   8.5  !  02-09  (G. Madec)  F90: Free form and module 
    192       !!   9.0  !  05-11  (V. Garnier) Surface pressure gradient organization 
    193       !!---------------------------------------------------------------------- 
    194       !! * Arguments 
    195       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
    196  
    197       !! * Local declarations 
    198       LOGICAL ::   ll_print = .FALSE.    ! =T print and flush numout 
    199       CHARACTER (len=40) ::           & 
    200          clhstnam, clop, clmx            ! temporary names 
    201       INTEGER ::   inum = 11             ! temporary logical unit 
    202       INTEGER ::   & 
    203          iimi, iima, ipk, it, itmod,  &  ! temporary integers 
    204          ijmi, ijma                      !    "          " 
    205       REAL(wp) ::   & 
    206          zsto, zout, zmax,            &  ! temporary scalars 
    207          zjulian, zdt                    !    "         " 
    208       REAL(wp), DIMENSION(jpi,jpj) :: & 
    209          zw2d                            ! temporary workspace 
     198      LOGICAL ::   ll_print = .FALSE.                        ! =T print and flush numout 
     199      CHARACTER (len=40) ::   clhstnam, clop, clmx           ! local names 
     200      INTEGER  ::   inum = 11                                ! temporary logical unit 
     201      INTEGER  ::   iimi, iima, ipk, it, itmod, ijmi, ijma   ! local integers 
     202      REAL(wp) ::   zsto, zout, zmax, zjulian, zdt           ! local scalars 
     203      REAL(wp), DIMENSION(jpi,jpj) ::   zw2d                 ! 2D workspace 
    210204      !!---------------------------------------------------------------------- 
    211205      ! 
     
    279273         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    280274            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    281             &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom ) 
     275            &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
    282276         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept 
    283277            &           "m", ipk, gdept_0, nz_T, "down" ) 
     
    292286         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
    293287            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    294             &          nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom ) 
     288            &          nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
    295289         CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept 
    296290            &           "m", ipk, gdept_0, nz_U, "down" ) 
     
    305299         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
    306300            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    307             &          nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom ) 
     301            &          nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
    308302         CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept 
    309303            &          "m", ipk, gdept_0, nz_V, "down" ) 
     
    318312         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    319313            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    320             &          nit000-1, zjulian, zdt, nh_W, nid_W, domain_id=nidom ) 
     314            &          nit000-1, zjulian, zdt, nh_W, nid_W, domain_id=nidom, snc4chunks=snc4set ) 
    321315         CALL histvert( nid_W, "depthw", "Vertical W levels",      &  ! Vertical grid: gdepw 
    322316            &          "m", ipk, gdepw_0, nz_W, "down" ) 
     
    346340!!$            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    347341!!$#endif 
    348          CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! emp 
     342         CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! (emp-rnf) 
    349343            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    350344!!$         CALL histdef( nid_T, "sorunoff", "Runoffs"                            , "Kg/m2/s",   &  ! runoffs 
    351345!!$            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    352          CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! emps 
    353             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    354          CALL histdef( nid_T, "sosalflx", "Surface Salt Flux"                  , "Kg/m2/s",   &  ! emps * sn 
     346         CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! (emps-rnf) 
     347            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     348         CALL histdef( nid_T, "sosalflx", "Surface Salt Flux"                  , "Kg/m2/s",   &  ! (emps-rnf) * sn 
    355349            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    356350         CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qns + qsr 
     
    383377            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    384378         CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping"         , "Kg/m2/s",   &  ! erp * sn 
    385             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    386 #endif 
    387 #if defined key_diaspr 
    388          CALL histdef( nid_T, "sosurfps", "Surface Pressure"                   , "cm"     ,   &  ! sp 
    389379            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    390380#endif 
     
    414404#endif  
    415405 
    416          CALL histend( nid_T ) 
     406         CALL histend( nid_T, snc4chunks=snc4set ) 
    417407 
    418408         !                                                                                      !!! nid_U : 3D 
     
    427417            &          jpi, jpj, nh_U, 1  , 1, 1  , - 99, 32, clop, zsto, zout ) 
    428418 
    429          CALL histend( nid_U ) 
     419         CALL histend( nid_U, snc4chunks=snc4set ) 
    430420 
    431421         !                                                                                      !!! nid_V : 3D 
     
    440430            &          jpi, jpj, nh_V, 1  , 1, 1  , - 99, 32, clop, zsto, zout ) 
    441431 
    442          CALL histend( nid_V ) 
     432         CALL histend( nid_V, snc4chunks=snc4set ) 
    443433 
    444434         !                                                                                      !!! nid_W : 3D 
     
    468458#endif 
    469459 
    470          CALL histend( nid_W ) 
     460         CALL histend( nid_W, snc4chunks=snc4set ) 
    471461 
    472462         IF(lwp) WRITE(numout,*) 
     
    498488!!$      CALL histwrite( nid_T, "sowaflep", it, fmass(:,:)    , ndim_hT, ndex_hT )   ! atmos=>ocean water flux 
    499489!!$#endif 
    500       CALL histwrite( nid_T, "sowaflup", it, emp           , ndim_hT, ndex_hT )   ! upward water flux 
     490      CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf )   , ndim_hT, ndex_hT )   ! upward water flux 
    501491!!$      CALL histwrite( nid_T, "sorunoff", it, runoff        , ndim_hT, ndex_hT )   ! runoff 
    502       CALL histwrite( nid_T, "sowaflcd", it, emps          , ndim_hT, ndex_hT )   ! c/d water flux 
    503       zw2d(:,:) = emps(:,:) * sn(:,:,1) * tmask(:,:,1) 
     492      CALL histwrite( nid_T, "sowaflcd", it, ( emps-rnf )  , ndim_hT, ndex_hT )   ! c/d water flux 
     493      zw2d(:,:) = ( emps(:,:) - rnf(:,:) ) * sn(:,:,1) * tmask(:,:,1) 
    504494      CALL histwrite( nid_T, "sosalflx", it, zw2d          , ndim_hT, ndex_hT )   ! c/d salt flux 
    505495      CALL histwrite( nid_T, "sohefldo", it, qns + qsr     , ndim_hT, ndex_hT )   ! total heat flux 
     
    521511      CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping 
    522512#endif 
    523 #if defined key_diaspr 
    524       CALL histwrite( nid_T, "sosurfps", it, gps           , ndim_hT, ndex_hT )   ! surface pressure 
    525 #endif 
    526          zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1) 
     513      zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1) 
    527514      CALL histwrite( nid_T, "sobowlin", it, zw2d          , ndim_hT, ndex_hT )   ! ??? 
    528515 
     
    583570         CALL histclo( nid_W ) 
    584571      ENDIF 
    585  
     572      ! 
    586573   END SUBROUTINE dia_wri 
    587574# endif 
     
    601588      !!      File 'output.init.nc'  is created if ninist = 1 (namelist) 
    602589      !!      File 'output.abort.nc' is created in case of abnormal job end 
    603       !! 
    604       !! History : 
    605       !!   8.2  !  00-06  (M. Imbard)  Original code (diabort.F) 
    606       !!   8.5  !  02-06  (A.Bozec, E. Durand)  Original code (diainit.F) 
    607       !!   9.0  !  02-12  (G. Madec)  merge of diabort and diainit, F90 
    608       !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization 
    609590      !!---------------------------------------------------------------------- 
    610       !! * Arguments 
    611591      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created 
    612592      INTEGER           , INTENT( in ) ::   kt               ! ocean time-step index 
    613  
    614       !! * Local declarations 
     593      !!  
    615594      CHARACTER (len=32) :: clname 
    616595      CHARACTER (len=40) :: clop 
    617       INTEGER  ::   & 
    618          id_i , nz_i, nh_i        
    619       INTEGER, DIMENSION(1) ::   & 
    620          idex             ! temprary workspace 
    621       REAL(wp) ::   & 
    622          zsto, zout, zmax,   & 
    623          zjulian, zdt 
     596      INTEGER  ::   id_i , nz_i, nh_i        
     597      INTEGER, DIMENSION(1) ::   idex             ! local workspace 
     598      REAL(wp) ::   zsto, zout, zmax, zjulian, zdt 
    624599      !!---------------------------------------------------------------------- 
    625600 
     
    649624      zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    650625      CALL histbeg( clname, jpi, glamt, jpj, gphit,   & 
    651           1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom )          ! Horizontal grid : glamt and gphit 
     626          1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit 
    652627      CALL histvert( id_i, "deptht", "Vertical T levels",   &    ! Vertical grid : gdept 
    653628          "m", jpk, gdept_0, nz_i, "down") 
     
    683658      CALL lim_wri_state_2( kt, id_i, nh_i ) 
    684659#else 
    685       CALL histend( id_i ) 
     660      CALL histend( id_i, snc4chunks=snc4set ) 
    686661#endif 
    687662 
     
    700675      CALL histwrite( id_i, "vomecrty", kt, vn       , jpi*jpj*jpk, idex )    ! now j-velocity 
    701676      CALL histwrite( id_i, "vovecrtz", kt, wn       , jpi*jpj*jpk, idex )    ! now k-velocity 
    702       CALL histwrite( id_i, "sowaflup", kt, emp      , jpi*jpj    , idex )    ! freshwater budget 
     677      CALL histwrite( id_i, "sowaflup", kt, (emp-rnf), jpi*jpj    , idex )    ! freshwater budget 
    703678      CALL histwrite( id_i, "sohefldo", kt, qsr + qns, jpi*jpj    , idex )    ! total heat flux 
    704679      CALL histwrite( id_i, "soshfldo", kt, qsr      , jpi*jpj    , idex )    ! solar heat flux 
Note: See TracChangeset for help on using the changeset viewer.