LCOV - code coverage report
Current view: top level - hemco/HEMCO/src/Shared/NcdfUtil - hco_m_netcdf_io_define.F90 (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 132 0.0 %
Date: 2025-03-13 18:42:46 Functions: 0 19 0.0 %

          Line data    Source code
       1             : !------------------------------------------------------------------------------
       2             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
       3             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
       4             : !------------------------------------------------------------------------------
       5             : !BOP
       6             : !
       7             : ! !MODULE: HCO_m_netcdf_io_define.F90
       8             : !
       9             : ! !INTERFACE:
      10             : !
      11             : MODULE HCO_m_netcdf_io_define
      12             : !
      13             : ! !USES:
      14             : !
      15             :   IMPLICIT NONE
      16             : !
      17             : ! !PUBLIC MEMBER FUNCTIONS:
      18             : !
      19             :   PUBLIC :: NcDef_Dimension
      20             :   PUBLIC :: NcDef_Variable
      21             :   PUBLIC :: NcSetFill
      22             :   PUBLIC :: NcEnd_Def
      23             :   PUBLIC :: NcBegin_Def
      24             : 
      25             :   PUBLIC :: NcDef_glob_attributes
      26             :   INTERFACE NcDef_glob_attributes
      27             :      MODULE PROCEDURE NcDef_glob_attributes_c
      28             :      MODULE PROCEDURE NcDef_glob_attributes_i
      29             :      MODULE PROCEDURE NcDef_glob_attributes_r4
      30             :      MODULE PROCEDURE NcDef_glob_attributes_r8
      31             :      MODULE PROCEDURE NcDef_glob_attributes_i_arr
      32             :      MODULE PROCEDURE NcDef_glob_attributes_r4_arr
      33             :      MODULE PROCEDURE NcDef_glob_attributes_r8_arr
      34             :   END INTERFACE NcDef_glob_attributes
      35             : 
      36             :   PUBLIC :: NcDef_var_attributes
      37             :   INTERFACE NcDef_var_attributes
      38             :      MODULE PROCEDURE NcDef_var_attributes_c
      39             :      MODULE PROCEDURE NcDef_var_attributes_i
      40             :      MODULE PROCEDURE NcDef_var_attributes_r4
      41             :      MODULE PROCEDURE NcDef_var_attributes_r8
      42             :      MODULE PROCEDURE NcDef_var_attributes_i_arr
      43             :      MODULE PROCEDURE NcDef_var_attributes_r4_arr
      44             :      MODULE PROCEDURE NcDef_var_attributes_r8_arr
      45             :   END INTERFACE NcDef_var_attributes
      46             : !
      47             : ! !PRIVATE MEMBER FUNCTIONS:
      48             : !
      49             :   PRIVATE :: NcDef_glob_attributes_c
      50             :   PRIVATE :: NcDef_glob_attributes_i
      51             :   PRIVATE :: NcDef_glob_attributes_r4
      52             :   PRIVATE :: NcDef_glob_attributes_r8
      53             :   PRIVATE :: NcDef_glob_attributes_i_arr
      54             :   PRIVATE :: NcDef_glob_attributes_r4_arr
      55             :   PRIVATE :: NcDef_glob_attributes_r8_arr
      56             :   PRIVATE :: NcDef_var_attributes_c
      57             :   PRIVATE :: NcDef_var_attributes_i
      58             :   PRIVATE :: NcDef_var_attributes_r4
      59             :   PRIVATE :: NcDef_var_attributes_r8
      60             :   PRIVATE :: NcDef_var_attributes_i_arr
      61             :   PRIVATE :: NcDef_var_attributes_r4_arr
      62             :   PRIVATE :: NcDef_var_attributes_r8_arr
      63             : !
      64             : ! !DESCRIPTION: Provides netCDF utility routines to define dimensions,
      65             : !  variables and attributes.
      66             : !\\
      67             : !\\
      68             : ! !AUTHOR:
      69             : !  Jules Kouatchou
      70             : !
      71             : ! !REVISION HISTORY:
      72             : !  See https://github.com/geoschem/ncdfutil for complete history
      73             : !EOP
      74             : !------------------------------------------------------------------------------
      75             : !BOC
      76             : CONTAINS
      77             : !EOC
      78             : !------------------------------------------------------------------------------
      79             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
      80             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
      81             : !------------------------------------------------------------------------------
      82             : !BOP
      83             : !
      84             : ! !IROUTINE: NcDef_dimension
      85             : !
      86             : ! !INTERFACE:
      87             : !
      88           0 :   SUBROUTINE NcDef_dimension(ncid,name,len,id,unlimited)
      89             : !
      90             : ! !USES:
      91             : !
      92             :     USE m_do_err_out
      93             : !
      94             :     IMPLICIT NONE
      95             : !
      96             :     INCLUDE 'netcdf.inc'
      97             : !
      98             : ! !INPUT PARAMETERS:
      99             : !!  ncid  : netCDF file id
     100             : !!  name  : dimension name
     101             : !!  len   : dimension number
     102             :     CHARACTER (LEN=*), INTENT(IN)  :: name
     103             :     INTEGER,           INTENT(IN)  :: ncid, len
     104             :     LOGICAL, OPTIONAL, INTENT(IN)  :: unlimited
     105             : !
     106             : ! !OUTPUT PARAMETERS:
     107             : !!  id    : dimension id
     108             :     INTEGER,           INTENT(OUT) :: id
     109             : 
     110             :     INTEGER  :: len0
     111             : !
     112             : ! !DESCRIPTION: Defines dimension.
     113             : !\\
     114             : !\\
     115             : ! !AUTHOR:
     116             : !  Jules Kouatchou and Maharaj Bhat
     117             : !
     118             : ! !REVISION HISTORY:
     119             : !  See https://github.com/geoschem/ncdfutil for complete history
     120             : !EOP
     121             : !------------------------------------------------------------------------------
     122             : !BOC
     123             : !
     124             : ! !LOCAL VARIABLES:
     125             :     CHARACTER (len=512) :: err_msg
     126             :     INTEGER :: ierr
     127             : 
     128             :     ! If unlimited variable is present and true,
     129             :     ! then make this dimension unlimited
     130           0 :     len0 = len
     131           0 :     if (present(unlimited)) then
     132           0 :        if (unlimited) then
     133           0 :           len0 = NF_UNLIMITED
     134             :        endif
     135             :     endif
     136             : 
     137           0 :     ierr = Nf_Def_Dim (ncid, name, len0, id)
     138             : 
     139           0 :     IF (ierr.ne.NF_NOERR) then
     140           0 :        err_msg = 'Nf_Def_Dim: can not define dimension : '// Trim (name)
     141           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     142             :     END IF
     143             : 
     144           0 :   END SUBROUTINE NcDef_dimension
     145             : !EOC
     146             : !------------------------------------------------------------------------------
     147             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     148             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     149             : !------------------------------------------------------------------------------
     150             : !BOP
     151             : !
     152             : ! !IROUTINE: NcDef_variable
     153             : !
     154             : ! !INTERFACE:
     155             : !
     156           0 :   SUBROUTINE NcDef_variable(ncid,name,type,ndims,dims,var_id,compress)
     157             : !
     158             : ! !USES:
     159             : !
     160             :     USE m_do_err_out
     161             : !
     162             :     IMPLICIT NONE
     163             : !
     164             :     INCLUDE 'netcdf.inc'
     165             : !
     166             : ! !INPUT PARAMETERS:
     167             : !
     168             : !!  ncid   : netCDF file id
     169             : !!  name   : name of the variable
     170             : !!  type   : type of the variable
     171             : !!           (NF_FLOAT, NF_CHAR, NF_INT, NF_DOUBLE, NF_BYTE, NF_SHORT)
     172             : !!  ndims  : number of dimensions of the variable
     173             : !!  dims   : netCDF dimension id of the variable
     174             :     CHARACTER (LEN=*), INTENT(IN)  :: name
     175             :     INTEGER,           INTENT(IN)  :: ncid, ndims
     176             :     INTEGER,           INTENT(IN)  :: dims(ndims)
     177             :     INTEGER,           INTENT(IN)  :: type
     178             :     LOGICAL, OPTIONAL, INTENT(IN)  :: compress
     179             : !
     180             : ! !OUTPUT PARAMETERS:
     181             : !
     182             : !!  varid  : netCDF variable id returned by NF_DEF_VAR
     183             :     INTEGER,           INTENT(OUT) :: var_id
     184             : !
     185             : ! !DESCRIPTION: Defines a netCDF variable.
     186             : !\\
     187             : !\\
     188             : ! !AUTHOR:
     189             : !  Jules Kouatchou and Maharaj Bhat
     190             : !
     191             : ! !REVISION HISTORY:
     192             : !  See https://github.com/geoschem/ncdfutil for complete history
     193             : !EOP
     194             : !------------------------------------------------------------------------------
     195             : !BOC
     196             : !
     197             : ! !LOCAL VARIABLES:
     198             :     character (len=512) :: err_msg
     199             :     integer ::  ierr
     200             :     logical ::  doStop
     201             :     ! Compression settings
     202             :     ! choose deflate_level=1 for fast, minimal compression.
     203             :     ! Informal testing suggests minimal benefit from higher compression level
     204             :     integer, parameter :: shuffle=1, deflate=1, deflate_level=1
     205             : !
     206           0 :     ierr = Nf_Def_Var (ncid, name, type, ndims, dims, var_id)
     207             : 
     208           0 :     IF (ierr.ne.NF_NOERR) THEN
     209           0 :        err_msg = 'Nf_Def_Var: can not define variable : '// Trim (name)
     210           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     211             :     END IF
     212             : 
     213             : #if defined( NC_HAS_COMPRESSION )
     214             :     !=====================================================================
     215             :     ! If the optional "compress" variable is used and set to TRUE,
     216             :     ! then enable variable compression (cdh, 0/17/17)
     217             :     !
     218             :     ! NOTE: We need to block this out with an #ifdef because some
     219             :     ! netCDF installations might lack the nf_def_var_deflate function
     220             :     ! which would cause a compile-time error. (bmy, 3/1/17)
     221             :     !
     222             :     ! ALSO NOTE: Newer versions of netCDF balk when you try to compress
     223             :     ! a scalar variable.  This generates an annoying warning message.
     224             :     ! To avoid this, only compress array variables. (bmy, 11/30/20)
     225             :     !=====================================================================
     226             :     if (present(Compress) .and. ndims > 0) then
     227             : 
     228             :        if (Compress) then
     229             : 
     230             :           ! Set compression
     231             :           ierr = nf_def_var_deflate( ncid, var_id,  shuffle,       &
     232             :                                            deflate, deflate_level )
     233             : 
     234             :           ! Check for errors.
     235             :           ! No message will be generated if the error is simply that the
     236             :           ! file is not netCDF-4
     237             :           ! (i.e. netCDF-3 don't support compression)
     238             :           IF ( (ierr.ne.NF_NOERR) .and. (ierr.ne.NF_ENOTNC4)) THEN
     239             : 
     240             :              ! Errors enabling compression will not halt the program
     241             :              doStop = .False.
     242             : 
     243             :              ! Print error
     244             :              err_msg = 'Nf_Def_Var_Deflate: can not compress variable : '// Trim (name)
     245             :              CALL Do_Err_Out (err_msg, doStop, 0, 0, 0, 0, 0.0d0, 0.0d0)
     246             :           END IF
     247             : 
     248             :        endif
     249             :     endif
     250             : #endif
     251             : 
     252           0 :   END SUBROUTINE NcDef_variable
     253             : !EOC
     254             : !------------------------------------------------------------------------------
     255             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     256             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     257             : !------------------------------------------------------------------------------
     258             : !BOP
     259             : !
     260             : ! !IROUTINE: NcDef_var_attributes
     261             : !
     262             : ! !INTERFACE:
     263             : !
     264           0 :   SUBROUTINE NcDef_var_attributes_c(ncid,var_id,att_name,att_val)
     265             : !
     266             : ! !USES:
     267             : !
     268             :     USE m_do_err_out
     269             : !
     270             :     IMPLICIT none
     271             :     INCLUDE 'netcdf.inc'
     272             : !
     273             : ! !INPUT PARAMETERS:
     274             : !!  ncid    : netCDF file id
     275             : !!  var_id  : netCDF variable id
     276             : !!  att_name: attribute name
     277             : !!  att_val : attribute value
     278             :     CHARACTER (LEN=*), INTENT(IN) :: att_name, att_val
     279             :     INTEGER,           INTENT(IN) :: ncid, var_id
     280             : !
     281             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: CHARACTER.
     282             : !\\
     283             : !\\
     284             : ! !AUTHOR:
     285             : !  Bob Yantosca (based on code by Jules Kouatchou and Maharaj Bhat)
     286             : !
     287             : ! !REVISION HISTORY:
     288             : !  See https://github.com/geoschem/ncdfutil for complete history
     289             : !EOP
     290             : !------------------------------------------------------------------------------
     291             : !BOC
     292             : !
     293             : ! !LOCAL VARIABLES:
     294             :     CHARACTER (LEN=512) :: err_msg
     295             :     INTEGER             :: mylen, ierr
     296             : !
     297           0 :     mylen = LEN(att_val)
     298           0 :     ierr = Nf_Put_Att_Text (ncid, var_id, att_name, mylen, att_val)
     299             : 
     300           0 :     IF (ierr.ne.NF_NOERR) THEN
     301             :        err_msg = 'NcDef_var_attributes_c: can not define attribute : ' // &
     302           0 :             TRIM (att_name)
     303           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     304             :     END IF
     305             : 
     306           0 :   END SUBROUTINE NcDef_var_attributes_c
     307             : !EOC
     308             : !------------------------------------------------------------------------------
     309             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     310             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     311             : !------------------------------------------------------------------------------
     312             : !BOP
     313             : !
     314             : ! !IROUTINE: NcDef_var_attributes_i
     315             : !
     316             : ! !INTERFACE:
     317             : !
     318           0 :   SUBROUTINE NcDef_var_attributes_i(ncid,var_id,att_name,att_val)
     319             : !
     320             : ! !USES:
     321             : !
     322             :     USE m_do_err_out
     323             : !
     324             :     IMPLICIT NONE
     325             :     INCLUDE 'netcdf.inc'
     326             : !
     327             : ! !INPUT PARAMETERS:
     328             : !!  ncid    : netCDF file id
     329             : !!  var_id  : netCDF variable id
     330             : !!  att_name: attribute name
     331             : !!  att_val : attribute value
     332             :     INTEGER,           INTENT(IN) :: att_val
     333             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     334             :     INTEGER,           INTENT(IN) :: ncid, var_id
     335             : !
     336             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: INTEGER.
     337             : !\\
     338             : !\\
     339             : ! !AUTHOR:
     340             : !  Bob Yantosca (based on code by Jules Kouatchou and Maharaj Bhat)
     341             : !
     342             : ! !REVISION HISTORY:
     343             : !  26 Sep 2013 - R. Yantosca - Initial version
     344             : !  See https://github.com/geoschem/ncdfutil for complete history
     345             : !EOP
     346             : !------------------------------------------------------------------------------
     347             : !BOC
     348             : !
     349             : ! !LOCAL VARIABLES:
     350             :     character (len=512) :: err_msg
     351             :     integer             :: mylen, ierr
     352             : !
     353           0 :     mylen = 1
     354             :     ierr  = Nf_Put_Att_Int( ncid,   var_id, att_name, &
     355           0 :                             NF_INT, mylen,  att_val )
     356             : 
     357           0 :     IF (ierr.ne.NF_NOERR) THEN
     358             :        err_msg = 'NcDef_var_attributes_i: can not define attribute : ' // &
     359           0 :             TRIM (att_name)
     360           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     361             :     END IF
     362             : 
     363           0 :   END SUBROUTINE NcDef_var_attributes_i
     364             : !EOC
     365             : !------------------------------------------------------------------------------
     366             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     367             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     368             : !------------------------------------------------------------------------------
     369             : !BOP
     370             : !
     371             : ! !IROUTINE: NcDef_var_attributes_r4
     372             : !
     373             : ! !INTERFACE:
     374             : !
     375           0 :   SUBROUTINE NcDef_var_attributes_r4(ncid,var_id,att_name,att_val)
     376             : !
     377             : ! !USES:
     378             : !
     379             :     USE m_do_err_out
     380             : 
     381             :     IMPLICIT NONE
     382             :     INCLUDE 'netcdf.inc'
     383             : !
     384             : ! !INPUT PARAMETERS:
     385             : !!  ncid    : netCDF file id
     386             : !!  var_id  : netCDF variable id
     387             : !!  att_name: attribute name
     388             : !!  att_val : attribute value
     389             :     REAL*4,            INTENT(IN) :: att_val
     390             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     391             :     INTEGER,           INTENT(IN) :: ncid, var_id
     392             : !
     393             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: REAL*4.
     394             : !\\
     395             : !\\
     396             : ! !AUTHOR:
     397             : !  Bob Yantosca (based on code by Jules Kouatchou and Maharaj Bhat)
     398             : !
     399             : ! !REVISION HISTORY:
     400             : !  26 Sep 2013 - R. Yantosca - Initial version
     401             : !  See https://github.com/geoschem/ncdfutil for complete history
     402             : !EOP
     403             : !------------------------------------------------------------------------------
     404             : !BOC
     405             : !
     406             : ! !LOCAL VARIABLES:
     407             :     CHARACTER (LEN=512) :: err_msg
     408             :     INTEGER             :: mylen, ierr
     409             : !
     410           0 :     mylen = 1
     411             :     ierr  = Nf_Put_Att_Real( ncid,     var_id, att_name, &
     412           0 :                              NF_FLOAT, mylen,  att_val )
     413             : 
     414           0 :     IF (ierr.ne.NF_NOERR) THEN
     415             :        err_msg = 'NcDef_var_attributes_r4: can not define attribute : ' // &
     416           0 :             TRIM (att_name)
     417           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     418             :     END IF
     419             : 
     420           0 :   END SUBROUTINE NcDef_var_attributes_r4
     421             : !EOC
     422             : !------------------------------------------------------------------------------
     423             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     424             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     425             : !------------------------------------------------------------------------------
     426             : !BOP
     427             : !
     428             : ! !IROUTINE: NcDef_var_attributes_r8
     429             : !
     430             : ! !INTERFACE:
     431             : !
     432           0 :   SUBROUTINE NcDef_var_attributes_r8(ncid,var_id,att_name,att_val)
     433             : !
     434             : ! !USES:
     435             : !
     436             :     USE m_do_err_out
     437             : !
     438             :     IMPLICIT none
     439             :     INCLUDE 'netcdf.inc'
     440             : !
     441             : ! !INPUT PARAMETERS:
     442             : !!  ncid    : netCDF file id
     443             : !!  var_id  : netCDF variable id
     444             : !!  att_name: attribute name
     445             : !!  att_val : attribute value
     446             :     REAL*8,            INTENT(IN) :: att_val
     447             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     448             :     INTEGER,           INTENT(IN) :: ncid, var_id
     449             : !
     450             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: REAL*4.
     451             : !\\
     452             : !\\
     453             : ! !AUTHOR:
     454             : !  Bob Yantosca (based on code by Jules Kouatchou and Maharaj Bhat)
     455             : !
     456             : ! !REVISION HISTORY:
     457             : !  20 Sep 2013 - R. Yantosca - Initial version
     458             : !  See https://github.com/geoschem/ncdfutil for complete history
     459             : !EOP
     460             : !------------------------------------------------------------------------------
     461             : !BOC
     462             : !
     463             : ! !LOCAL VARIABLES:
     464             :     CHARACTER (LEN=512) :: err_msg
     465             :     INTEGER             ::  mylen, ierr
     466             : !
     467           0 :     mylen = 1
     468             :     ierr  = Nf_Put_Att_Double( ncid,      var_id, att_name, &
     469           0 :                                NF_DOUBLE, mylen,  att_val )
     470             : 
     471           0 :     IF (ierr.ne.NF_NOERR) THEN
     472             :        err_msg = 'NcDef_var_attributes_r8: can not define attribute : ' // &
     473           0 :             TRIM (att_name)
     474           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     475             :     END IF
     476             : 
     477           0 :   END SUBROUTINE NcDef_var_attributes_r8
     478             : !EOC
     479             : !------------------------------------------------------------------------------
     480             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     481             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     482             : !------------------------------------------------------------------------------
     483             : !BOP
     484             : !
     485             : ! !IROUTINE: NcDef_var_attributes_i_arr
     486             : !
     487             : ! !INTERFACE:
     488             : !
     489           0 :   SUBROUTINE NcDef_var_attributes_i_arr(ncid,var_id,att_name,att_val)
     490             : !
     491             : ! !USES:
     492             : !
     493             :     USE m_do_err_out
     494             : !
     495             :     IMPLICIT none
     496             :     INCLUDE 'netcdf.inc'
     497             : !
     498             : ! !INPUT PARAMETERS:
     499             : !!  ncid    : netCDF file id
     500             : !!  var_id  : netCDF variable id
     501             : !!  att_name: attribute name
     502             : !!  att_val : attribute value
     503             :     INTEGER,           INTENT(IN) :: att_val(:)
     504             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     505             :     INTEGER,           INTENT(IN) :: ncid, var_id
     506             : !
     507             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: INTEGER vector.
     508             : !\\
     509             : !\\
     510             : ! !AUTHOR:
     511             : !  Bob Yantosca (based on code by Jules Kouatchou and Maharaj Bhat)
     512             : !
     513             : ! !REVISION HISTORY:
     514             : !  26 Sep 2013 - R. Yantosca - Initial version
     515             : !  See https://github.com/geoschem/ncdfutil for complete history
     516             : !EOP
     517             : !------------------------------------------------------------------------------
     518             : !BOC
     519             : !
     520             : ! !LOCAL VARIABLES:
     521             :     CHARACTER (LEN=512) :: err_msg
     522             :     INTEGER             :: mylen, ierr
     523             : !
     524           0 :     mylen = SIZE( att_val )
     525             :     ierr  = Nf_Put_Att_Int( ncid,   var_id, att_name, &
     526           0 :                             NF_INT, mylen,  att_val )
     527             : 
     528           0 :     iF (ierr.ne.NF_NOERR) THEN
     529             :        err_msg = 'NcDef_var_attributes_i_arr: can not define attribute : ' &
     530           0 :             // TRIM (att_name)
     531           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     532             :     END IF
     533             : 
     534           0 :   END SUBROUTINE NcDef_var_attributes_i_arr
     535             : !EOC
     536             : !------------------------------------------------------------------------------
     537             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     538             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     539             : !------------------------------------------------------------------------------
     540             : !BOP
     541             : !
     542             : ! !IROUTINE: NcDef_var_attributes_r4_arr
     543             : !
     544             : ! !INTERFACE:
     545             : !
     546           0 :   SUBROUTINE NcDef_var_attributes_r4_arr(ncid,var_id,att_name,att_val)
     547             : !
     548             : ! !USES:
     549             : !
     550             :     USE m_do_err_out
     551             : !
     552             :     IMPLICIT none
     553             :     INCLUDE 'netcdf.inc'
     554             : !
     555             : ! !INPUT PARAMETERS:
     556             : !!  ncid    : netCDF file id
     557             : !!  var_id  : netCDF variable id
     558             : !!  att_name: attribute name
     559             : !!  att_val : attribute value
     560             :     REAL*4,            INTENT(IN) :: att_val(:)
     561             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     562             :     INTEGER,           INTENT(IN) :: ncid, var_id
     563             : !
     564             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: REAL*4 vector
     565             : !\\
     566             : !\\
     567             : ! !AUTHOR:
     568             : !  Bob Yantosca (based on code by Jules Kouatchou and Maharaj Bhat)
     569             : !
     570             : ! !REVISION HISTORY:
     571             : !  26 Sep 2013 - R. Yantosca - Initial version
     572             : !  See https://github.com/geoschem/ncdfutil for complete history
     573             : !EOP
     574             : !------------------------------------------------------------------------------
     575             : !BOC
     576             : !
     577             : ! !LOCAL VARIABLES:
     578             :     CHARACTER (LEN=512) :: err_msg
     579             :     INTEGER             :: mylen, ierr
     580             : !
     581           0 :     mylen = SIZE( att_val )
     582             :     ierr  = Nf_Put_Att_Real( ncid,     var_id, att_name, &
     583           0 :                              NF_FLOAT, mylen,  att_val )
     584             : 
     585           0 :     IF (ierr.ne.NF_NOERR) THEN
     586             :        err_msg = 'NcDef_var_attributes_r4_arr: can not define attribute : ' &
     587           0 :                     // TRIM (att_name)
     588           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     589             :     END IF
     590             : 
     591           0 :   END SUBROUTINE NcDef_var_attributes_r4_arr
     592             : !EOC
     593             : !------------------------------------------------------------------------------
     594             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     595             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     596             : !------------------------------------------------------------------------------
     597             : !BOP
     598             : !
     599             : ! !IROUTINE: NcDef_var_attributes_r8_arr
     600             : !
     601             : ! !INTERFACE:
     602             : !
     603           0 :   SUBROUTINE NcDef_var_attributes_r8_arr(ncid,var_id,att_name,att_val)
     604             : !
     605             : ! !USES:
     606             : !
     607             :     USE m_do_err_out
     608             : !
     609             :     IMPLICIT NONE
     610             :     INCLUDE 'netcdf.inc'
     611             : !
     612             : ! !INPUT PARAMETERS:
     613             : !!    ncid    : netCDF file id
     614             : !!    var_id  : netCDF variable id
     615             : !!    att_name: attribute name
     616             : !!    att_val : attribute value
     617             :     REAL*8,            INTENT(IN) :: att_val(:)
     618             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     619             :     INTEGER,           INTENT(IN) :: ncid, var_id
     620             : !
     621             : ! !DESCRIPTION: Defines a netCDF variable attribute of type: REAL*8 vector
     622             : !\\
     623             : !\\
     624             : ! !AUTHOR:
     625             : !  Jules Kouatchou and Maharaj Bhat
     626             : !
     627             : ! !REVISION HISTORY:
     628             : !  20 Sep 2013 - R. Yantosca - Initial version
     629             : !  See https://github.com/geoschem/ncdfutil for complete history
     630             : !EOP
     631             : !------------------------------------------------------------------------------
     632             : !BOC
     633             : !
     634             : ! !LOCAL VARIABLES:
     635             :     character (len=512) :: err_msg
     636             :     integer             ::  mylen, ierr
     637             : !
     638           0 :     mylen = size( att_val )
     639             :     ierr  = Nf_Put_Att_Double( ncid,      var_id, att_name, &
     640           0 :                                NF_DOUBLE, mylen,  att_val )
     641             : 
     642           0 :     IF (ierr.ne.NF_NOERR) THEN
     643             :        err_msg = 'NcDef_var_attributes_r4_arr: can not define attribute : '&
     644           0 :                      // Trim (att_name)
     645           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     646             :     END IF
     647             : 
     648           0 :   END SUBROUTINE NcDef_var_attributes_r8_arr
     649             : !EOC
     650             : !------------------------------------------------------------------------------
     651             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     652             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     653             : !------------------------------------------------------------------------------
     654             : !BOP
     655             : !
     656             : ! !IROUTINE: NcDef_glob_attributes_c
     657             : !
     658             : ! !INTERFACE:
     659             : !
     660           0 :   SUBROUTINE NcDef_glob_attributes_c(ncid,att_name,att_val)
     661             : !
     662             : ! !USES:
     663             : !
     664             :     USE m_do_err_out
     665             : !
     666             :     IMPLICIT NONE
     667             : !
     668             :     INCLUDE 'netcdf.inc'
     669             : !
     670             : ! !INPUT PARAMETERS:
     671             : !!  ncid    : netCDF file id
     672             : !!  att_name: attribute name
     673             : !!  att_val : attribute value
     674             : !
     675             :     CHARACTER (LEN=*), INTENT(IN) :: att_val
     676             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     677             :     INTEGER,           INTENT(IN) :: ncid
     678             : !
     679             : ! !DESCRIPTION: Defines global attributes of type: CHARACTER
     680             : !\\
     681             : !\\
     682             : ! !AUTHOR:
     683             : !  Bob Yantosca( based on code by Jules Kouatchou)
     684             : !
     685             : ! !REVISION HISTORY:
     686             : !  26 Sep 2013 - R. Yantosca - Initial version
     687             : !  See https://github.com/geoschem/ncdfutil for complete history
     688             : !EOP
     689             : !-------------------------------------------------------------------------
     690             : !BOC
     691             : !
     692             : ! !LOCAL VARIABLES:
     693             :     CHARACTER (LEN=512) :: err_msg
     694             :     INTEGER             ::  mylen, ierr
     695             : !
     696           0 :     mylen = len(att_val)
     697           0 :     ierr = Nf_Put_Att_Text (ncid, NF_GLOBAL, att_name, mylen, att_val)
     698             : 
     699           0 :     IF (ierr.ne.NF_NOERR) THEN
     700             :        err_msg = 'NcDef_glob_attributes_c: can not define attribute : ' // &
     701           0 :             TRIM (att_name)
     702           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     703             :     END IF
     704             : 
     705           0 :   END SUBROUTINE NcDef_glob_attributes_c
     706             : !EOC
     707             : !------------------------------------------------------------------------------
     708             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     709             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     710             : !------------------------------------------------------------------------------
     711             : !BOP
     712             : !
     713             : ! !IROUTINE: NcDef_glob_attributes_i
     714             : !
     715             : ! !INTERFACE:
     716             : !
     717           0 :   SUBROUTINE NcDef_glob_attributes_i(ncid,att_name,att_val)
     718             : !
     719             : ! !USES:
     720             : !
     721             :     USE m_do_err_out
     722             : !
     723             :     IMPLICIT none
     724             : !
     725             :     INCLUDE 'netcdf.inc'
     726             : !
     727             : ! !INPUT PARAMETERS:
     728             : !!    ncid    : netCDF file id
     729             : !!    att_name: attribute name
     730             : !!    att_val : attribute value
     731             : !
     732             :     INTEGER,           INTENT(IN) :: att_val
     733             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     734             :     INTEGER,           INTENT(IN) :: NCID
     735             : !
     736             : ! !DESCRIPTION: Defines global attributes of type: INTEGER
     737             : !\\
     738             : !\\
     739             : ! !AUTHOR:
     740             : !  Bob Yantosca( based on code by Jules Kouatchou)
     741             : !
     742             : ! !REVISION HISTORY:
     743             : !  26 Sep 2013 - R. Yantosca - Initial version
     744             : !  See https://github.com/geoschem/ncdfutil for complete history
     745             : !EOP
     746             : !-------------------------------------------------------------------------
     747             : !BOC
     748             : !
     749             : ! !LOCAL VARIABLES:
     750             :     CHARACTER (LEN=512) :: err_msg
     751             :     INTEGER             :: mylen, ierr
     752             : !
     753           0 :     mylen = 1
     754             :     ierr  = Nf_Put_Att_Int( ncid,   NF_GLOBAL, att_name, &
     755           0 :                             NF_INT, mylen,     att_val )
     756             : 
     757           0 :     IF (ierr.ne.NF_NOERR) THEN
     758             :        err_msg = 'NcDef_glob_attributes_i: can not define attribute : ' // &
     759           0 :             TRIM (att_name)
     760           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     761             :     END IF
     762             : 
     763           0 :   END SUBROUTINE NcDef_glob_attributes_i
     764             : !EOC
     765             : !------------------------------------------------------------------------------
     766             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     767             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     768             : !------------------------------------------------------------------------------
     769             : !BOP
     770             : !
     771             : ! !IROUTINE: NcDef_glob_attributes_r4
     772             : !
     773             : ! !INTERFACE:
     774             : !
     775           0 :   SUBROUTINE NcDef_glob_attributes_r4(ncid,att_name,att_val)
     776             : !
     777             : ! !USES:
     778             : !
     779             :     USE m_do_err_out
     780             : !
     781             :     IMPLICIT NONE
     782             : !
     783             :     INCLUDE 'netcdf.inc'
     784             : !
     785             : ! !INPUT PARAMETERS:
     786             : !!  ncid    : netCDF file id
     787             : !!  att_name: attribute name
     788             : !!  att_val : attribute value
     789             : !
     790             :     REAL*4,            INTENT(IN) :: att_val
     791             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     792             :     INTEGER,           INTENT(IN) :: ncid
     793             : !
     794             : ! !DESCRIPTION: Defines global attributes of type: REAL*4
     795             : !\\
     796             : !\\
     797             : ! !AUTHOR:
     798             : !  Bob Yantosca( based on code by Jules Kouatchou)
     799             : !
     800             : ! !REVISION HISTORY:
     801             : !  26 Sep 2013 - R. Yantosca - Initial version
     802             : !  See https://github.com/geoschem/ncdfutil for complete history
     803             : !EOP
     804             : !-------------------------------------------------------------------------
     805             : !BOC
     806             : !
     807             : ! !LOCAL VARIABLES:
     808             :     character (len=512) :: err_msg
     809             :     integer             :: mylen, ierr
     810             : !
     811           0 :     mylen = 1
     812             :     ierr  = Nf_Put_Att_Real( ncid,     NF_GLOBAL, att_name, &
     813           0 :                              NF_FLOAT, mylen,     att_val )
     814             : 
     815           0 :     IF (ierr.ne.NF_NOERR) THEN
     816             :        err_msg = 'NcDef_glob_attributes_r4: can not define attribute : ' // &
     817           0 :             TRIM (att_name)
     818           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     819             :     END IF
     820             : 
     821           0 :   END SUBROUTINE NcDef_glob_attributes_r4
     822             : !EOC
     823             : !------------------------------------------------------------------------------
     824             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     825             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     826             : !------------------------------------------------------------------------------
     827             : !BOP
     828             : !
     829             : ! !IROUTINE: NcDef_glob_attributes_r8
     830             : !
     831             : ! !INTERFACE:
     832             : !
     833           0 :   SUBROUTINE NcDef_glob_attributes_r8(ncid,att_name,att_val)
     834             : !
     835             : ! !USES:
     836             : !
     837             :     USE m_do_err_out
     838             : !
     839             :     IMPLICIT NONE
     840             : !
     841             :     INCLUDE 'netcdf.inc'
     842             : !
     843             : ! !INPUT PARAMETERS:
     844             : !!    ncid    : netCDF file id
     845             : !!    att_name: attribute name
     846             : !!    att_val : attribute value
     847             : !
     848             :     REAL*8,            INTENT(IN) :: att_val
     849             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     850             :     INTEGER,           INTENT(IN) :: ncid
     851             : !
     852             : ! !DESCRIPTION: Defines global attributes of type: REAL*4
     853             : !\\
     854             : !\\
     855             : ! !AUTHOR:
     856             : !  Bob Yantosca( based on code by Jules Kouatchou)
     857             : !
     858             : ! !REVISION HISTORY:
     859             : !  26 Sep 2013 - R. Yantosca - Initial version
     860             : !  See https://github.com/geoschem/ncdfutil for complete history
     861             : !EOP
     862             : !-------------------------------------------------------------------------
     863             : !BOC
     864             : !
     865             : ! !LOCAL VARIABLES:
     866             :     character (len=512) :: err_msg
     867             :     integer             :: mylen, ierr
     868             : !
     869           0 :     mylen = 1
     870             :     ierr  = Nf_Put_Att_Double( ncid,     NF_GLOBAL, att_name, &
     871           0 :                                NF_FLOAT, mylen,     att_val )
     872             : 
     873           0 :     IF (ierr.ne.NF_NOERR) THEN
     874             :        err_msg = 'NcDef_glob_attributes_r8: can not define attribute : ' // &
     875           0 :             TRIM (att_name)
     876           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     877             :     END IF
     878             : 
     879           0 :   END SUBROUTINE NcDef_glob_attributes_r8
     880             : !EOC
     881             : !------------------------------------------------------------------------------
     882             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     883             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     884             : !------------------------------------------------------------------------------
     885             : !BOP
     886             : !
     887             : ! !IROUTINE: NcDef_glob_attributes_i_arr
     888             : !
     889             : ! !INTERFACE:
     890             : !
     891           0 :   SUBROUTINE NcDef_glob_attributes_i_arr(ncid,att_name,att_val)
     892             : !
     893             : ! !USES:
     894             : !
     895             :     USE m_do_err_out
     896             : !
     897             :     IMPLICIT NONE
     898             : !
     899             :     INCLUDE 'netcdf.inc'
     900             : !
     901             : ! !INPUT PARAMETERS:
     902             : !!    ncid    : netCDF file id
     903             : !!    att_name: attribute name
     904             : !!    att_val : attribute value
     905             : !
     906             :     INTEGER,           INTENT(IN) :: att_val(:)
     907             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     908             :     INTEGER,           INTENT(IN) :: ncid
     909             : !
     910             : ! !DESCRIPTION: Defines global attributes of type: INTEGER vector
     911             : !\\
     912             : !\\
     913             : ! !AUTHOR:
     914             : !  Bob Yantosca( based on code by Jules Kouatchou)
     915             : !
     916             : ! !REVISION HISTORY:
     917             : !  26 Sep 2013 - R. Yantosca - Initial version
     918             : !  See https://github.com/geoschem/ncdfutil for complete history
     919             : !EOP
     920             : !-------------------------------------------------------------------------
     921             : !BOC
     922             : !
     923             : ! !LOCAL VARIABLES:
     924             :     CHARACTER (LEN=512) :: err_msg
     925             :     INTEGER             :: mylen, ierr
     926             : !
     927           0 :     mylen = SIZE( att_val )
     928             :     ierr  = Nf_Put_Att_Int( ncid,   NF_GLOBAL, att_name, &
     929           0 :                             NF_INT, mylen,     att_val )
     930             : 
     931           0 :     IF (ierr.ne.NF_NOERR) THEN
     932             :        err_msg = 'NcDef_glob_attributes_i_arr: can not define attribute : ' &
     933           0 :             // Trim (att_name)
     934           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     935             :     END IF
     936             : 
     937           0 :   END SUBROUTINE NcDef_glob_attributes_i_arr
     938             : !EOC
     939             : !------------------------------------------------------------------------------
     940             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     941             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
     942             : !------------------------------------------------------------------------------
     943             : !BOP
     944             : !
     945             : ! !IROUTINE: NcDef_glob_attributes_r4_arr
     946             : !
     947             : ! !INTERFACE:
     948             : !
     949           0 :   SUBROUTINE NcDef_glob_attributes_r4_arr(ncid,att_name,att_val)
     950             : !
     951             : ! !USES:
     952             : !
     953             :     USE m_do_err_out
     954             : !
     955             :     IMPLICIT none
     956             : !
     957             :     INCLUDE 'netcdf.inc'
     958             : !
     959             : ! !INPUT PARAMETERS:
     960             : !!  ncid    : netCDF file id
     961             : !!  att_name: attribute name
     962             : !!  att_val : attribute value
     963             : !
     964             :     REAL*4,            INTENT(IN) :: att_val(:)
     965             :     CHARACTER (LEN=*), INTENT(IN) :: att_name
     966             :     INTEGER,           INTENT(IN) :: ncid
     967             : !
     968             : ! !DESCRIPTION: Defines global attributes of type: REAL*4 vector
     969             : !\\
     970             : !\\
     971             : ! !AUTHOR:
     972             : !  Bob Yantosca( based on code by Jules Kouatchou)
     973             : !
     974             : ! !REVISION HISTORY:
     975             : !  26 Sep 2013 - R. Yantosca - Initial version
     976             : !  See https://github.com/geoschem/ncdfutil for complete history
     977             : !EOP
     978             : !-------------------------------------------------------------------------
     979             : !BOC
     980             : !
     981             : ! !LOCAL VARIABLES:
     982             :     character (len=512) :: err_msg
     983             :     integer             :: mylen, ierr
     984             : !
     985           0 :     mylen = SIZE( att_val )
     986             :     ierr  = Nf_Put_Att_Real( ncid,     NF_GLOBAL, att_name, &
     987           0 :                              NF_FLOAT, mylen,     att_val )
     988             : 
     989           0 :     IF (ierr.ne.NF_NOERR) THEN
     990             :        err_msg = 'NcDef_glob_attributes_r4_arr: can not define attribute : ' &
     991           0 :               // TRIM (att_name)
     992           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
     993             :     END IF
     994             : 
     995           0 :   END SUBROUTINE NcDef_glob_attributes_r4_arr
     996             : !EOC
     997             : !------------------------------------------------------------------------------
     998             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
     999             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
    1000             : !------------------------------------------------------------------------------
    1001             : !BOP
    1002             : !
    1003             : ! !IROUTINE: NcDef_glob_attributes_r8_arr
    1004             : !
    1005             : ! !INTERFACE:
    1006             : !
    1007           0 :   SUBROUTINE NcDef_glob_attributes_r8_arr(ncid,att_name,att_val)
    1008             : !
    1009             : ! !USES:
    1010             : !
    1011             :     USE m_do_err_out
    1012             : !
    1013             :     IMPLICIT none
    1014             : !
    1015             :     INCLUDE 'netcdf.inc'
    1016             : !
    1017             : ! !INPUT PARAMETERS:
    1018             : !!  ncid    : netCDF file id
    1019             : !!  att_name: attribute name
    1020             : !!  att_val : attribute value
    1021             : !
    1022             :     REAL*8,            intent(in) :: att_val(:)
    1023             :     character (len=*), intent(in) :: att_name
    1024             :     integer,           intent(in) :: ncid
    1025             : !
    1026             : ! !DESCRIPTION: Defines global attributes of type: REAL*8 vector
    1027             : !\\
    1028             : !\\
    1029             : ! !AUTHOR:
    1030             : !  Bob Yantosca( based on code by Jules Kouatchou)
    1031             : !
    1032             : ! !REVISION HISTORY:
    1033             : !  26 Sep 2013 - R. Yantosca - Initial version
    1034             : !  See https://github.com/geoschem/ncdfutil for complete history
    1035             : !EOP
    1036             : !-------------------------------------------------------------------------
    1037             : !BOC
    1038             : !
    1039             : ! !LOCAL VARIABLES:
    1040             :     character (len=512) :: err_msg
    1041             :     integer             :: mylen, ierr
    1042             : !
    1043           0 :     mylen = SIZE( att_val )
    1044             :     ierr  = Nf_Put_Att_Double( ncid,     NF_GLOBAL, att_name, &
    1045           0 :                                NF_FLOAT, mylen,     att_val )
    1046             : 
    1047           0 :     IF (ierr.ne.NF_NOERR) THEN
    1048             :        err_msg = 'NcDef_glob_attributes_r8_arr: can not define attribute : ' &
    1049           0 :             // TRIM (att_name)
    1050           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
    1051             :     END IF
    1052             : 
    1053           0 :   END SUBROUTINE NcDef_glob_attributes_r8_arr
    1054             : !EOC
    1055             : !------------------------------------------------------------------------------
    1056             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
    1057             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
    1058             : !------------------------------------------------------------------------------
    1059             : !BOP
    1060             : !
    1061             : ! !IROUTINE: NcSetFill
    1062             : !
    1063             : ! !INTERFACE:
    1064             : !
    1065           0 :   SUBROUTINE NcSetFill(ncid,ifill,omode)
    1066             : !
    1067             : ! !USES:
    1068             : !
    1069             :     USE m_do_err_out
    1070             : !
    1071             :     IMPLICIT NONE
    1072             : !
    1073             :     INCLUDE 'netcdf.inc'
    1074             : !
    1075             : ! !INPUT PARAMETERS:
    1076             : !
    1077             :     INTEGER, INTENT(in) :: ncid, ifill,omode
    1078             : !
    1079             : ! !DESCRIPTION: Sets fill method.
    1080             : !\\
    1081             : !\\
    1082             : ! !AUTHOR:
    1083             : !  Jules Kouatchou
    1084             : !
    1085             : ! !REVISION HISTORY:
    1086             : !  See https://github.com/geoschem/ncdfutil for complete history
    1087             : !EOP
    1088             : !-------------------------------------------------------------------------
    1089             : !BOC
    1090             : !
    1091             : ! !LOCAL VARIABLES:
    1092             :     character (len=512) :: err_msg
    1093             :     integer             ::  mylen, ierr
    1094             : !
    1095           0 :     ierr = Nf_Set_Fill (ncid, NF_NOFILL, omode)
    1096             : 
    1097           0 :     IF (ierr.ne.NF_NOERR) THEN
    1098           0 :        err_msg = 'Nf_Set_FIll: Error in omode  '
    1099           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
    1100             :     END IF
    1101             : 
    1102           0 :   END SUBROUTINE NcSetFill
    1103             : !EOC
    1104             : !------------------------------------------------------------------------------
    1105             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
    1106             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
    1107             : !------------------------------------------------------------------------------
    1108             : !BOP
    1109             : !
    1110             : ! !IROUTINE: NcEnd_Def
    1111             : !
    1112             : ! !INTERFACE:
    1113             : !
    1114           0 :   SUBROUTINE NcEnd_Def(ncid)
    1115             : !
    1116             : ! !USES:
    1117             : !
    1118             :     USE m_do_err_out
    1119             : !
    1120             :     IMPLICIT NONE
    1121             : !
    1122             :     INCLUDE 'netcdf.inc'
    1123             : !
    1124             : ! !INPUT PARAMETERS:
    1125             : !
    1126             :     INTEGER, INTENT(IN) :: ncid
    1127             : !
    1128             : ! !DESCRIPTION: Ends definitions of variables and their attributes.
    1129             : !\\
    1130             : !\\
    1131             : ! !AUTHOR:
    1132             : !  Jules Kouatchou
    1133             : !
    1134             : ! !REVISION HISTORY:
    1135             : !  See https://github.com/geoschem/ncdfutil for complete history
    1136             : !EOP
    1137             : !-------------------------------------------------------------------------
    1138             : !BOC
    1139             : !
    1140             : ! !LOCAL VARIABLES:
    1141             :     CHARACTER (LEN=512) :: err_msg
    1142             :     INTEGER             ::  ierr
    1143             : !
    1144           0 :     ierr = Nf_Enddef (ncid)
    1145             : 
    1146           0 :     IF (ierr.ne.NF_NOERR) THEN
    1147           0 :        err_msg = 'Nf_EndDef: Error in closing netCDF define mode!'
    1148           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
    1149             :     END IF
    1150             : 
    1151           0 :   END SUBROUTINE NcEnd_def
    1152             : !EOC
    1153             : !------------------------------------------------------------------------------
    1154             : !       NcdfUtilities: by Harvard Atmospheric Chemistry Modeling Group        !
    1155             : !                      and NASA/GSFC, SIVO, Code 610.3                        !
    1156             : !------------------------------------------------------------------------------
    1157             : !BOP
    1158             : !
    1159             : ! !IROUTINE: NcBegin_Def
    1160             : !
    1161             : ! !INTERFACE:
    1162             : !
    1163           0 :   SUBROUTINE NcBegin_Def(ncid)
    1164             : !
    1165             : ! !USES:
    1166             : !
    1167             :     USE m_do_err_out
    1168             : !
    1169             :     IMPLICIT none
    1170             : !
    1171             :     INCLUDE 'netcdf.inc'
    1172             : !
    1173             : ! !INPUT PARAMETERS:
    1174             : !
    1175             :     INTEGER, INTENT(IN) :: ncid
    1176             : !
    1177             : ! !DESCRIPTION: Opens (or re-opens) netCDF define mode, where variables
    1178             : !  and attributes can be defined.
    1179             : !\\
    1180             : !\\
    1181             : ! !AUTHOR:
    1182             : !  Jules Kouatchou
    1183             : !
    1184             : ! !REVISION HISTORY:
    1185             : !  14 May 2014 - R. Yantosca - Initial version
    1186             : !  See https://github.com/geoschem/ncdfutil for complete history
    1187             : !EOP
    1188             : !-------------------------------------------------------------------------
    1189             : !BOC
    1190             : !
    1191             : ! !LOCAL VARIABLES:
    1192             :     character (len=512) :: err_msg
    1193             :     integer             :: ierr
    1194             : !
    1195           0 :     ierr = Nf_Redef (ncid)
    1196             : 
    1197           0 :     IF (ierr.ne.NF_NOERR) THEN
    1198           0 :        err_msg = 'Nf_ReDef: Error in opening netCDF define mode!'
    1199           0 :        CALL Do_Err_Out (err_msg, .true., 0, 0, 0, 0, 0.0d0, 0.0d0)
    1200             :     END IF
    1201             : 
    1202           0 :   END SUBROUTINE NcBegin_Def
    1203             : !EOC
    1204             : END MODULE HCO_m_netcdf_io_define

Generated by: LCOV version 1.14